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 -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -