php - Whole variable including question mark and equals sign in preg_match -
php - Whole variable including question mark and equals sign in preg_match -
i have code:
$uri = $_server["request_uri"]; if (preg_match("/smda/", $uri)) { echo "whatever; }
which catches url contains "smda". want narrow url contains src=smda. right in thinking code this?
$uri = $_server["request_uri"]; if (preg_match("/src=smda/", $uri)) { echo "whatever; }
proper , easy 1 is
if (isset($_get['src']) && $_get['src'] == 'smda') { echo "whatever"; }
php preg-match
Comments
Post a Comment