magnetica Posted August 1, 2010 Share Posted August 1, 2010 Hi all I am grabbing the _SERVER['REQUEST_URI'] and trying to compare it but this doesnt work $currpage = $_SERVER['REQUEST_URI'];//when i echo this i get ' / ' $home = '/'; //but this doesnt work if(strpos($currpage, $home)){echo 'test works';} PS It will work if i use if($currpage == $home){echo 'test2';} Any ideas? Thanks, Magnetica Link to comment https://forums.phpfreaks.com/topic/209510-simple-strpos-problem/ Share on other sites More sharing options...
Alex Posted August 1, 2010 Share Posted August 1, 2010 if(strpos($currpage, $home) !== false){echo 'test works';} strpos - See example #2 Link to comment https://forums.phpfreaks.com/topic/209510-simple-strpos-problem/#findComment-1093857 Share on other sites More sharing options...
magnetica Posted August 1, 2010 Author Share Posted August 1, 2010 Perfect. Told you it'd be simple! Thanks alot AlexWD Link to comment https://forums.phpfreaks.com/topic/209510-simple-strpos-problem/#findComment-1093858 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.