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

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -