daniel daniel - 5 months ago 23
PHP Question

compare variable with $_SERVER['REQUEST_URI']

I have got variable

. This Variable holds the value of the page on which I am.
Need to compare this expression:

if ($_SERVER['REQUEST_URI'] === '/index.php?page='.$page)

but its not working


Seems like it would be much more simple to do:

if ($_GET['page'] == $page)

This would also continue to work if you have more than just page in your query string.