daniel daniel - 1 year ago 64
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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download