Jump to content

Simple strpos problem


magnetica

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.