I am building a simple admin area for my site and I want the URLs to look somewhat like this:
http://mysite.com/admin/?home
http://mysite.com/admin/?settings
htt
As well as the ones mentioned, another option would be key($_GET)
, which would return the first key of the $_GET array which would mean it would work with URLs with other parameters
www.example.com/?home&myvar = 1;
The one issue is that you may want to use reset() on the array first if you have modified the array pointer as key
returns the key of the element array pointer is currently pointing to.