Hi,
If I can get a list of the $_GET values passed by my script by doing a simple foreach loop on $_GET, how can I get key/value pairs?
I need both the key and the value.Code:foreach ($_GET as $value) { echo $value."<br/>"; }
Thanks,
Tom
| SitePoint Sponsor |



Hi,
If I can get a list of the $_GET values passed by my script by doing a simple foreach loop on $_GET, how can I get key/value pairs?
I need both the key and the value.Code:foreach ($_GET as $value) { echo $value."<br/>"; }
Thanks,
Tom





PHP Code:foreach($_GET as $key => $value) {
echo "value: " . $value . "<br>";
echo "key: " . $key . "<br>";
}
OMFG SitePoint ROXORZ TEH BIG ONE111!
Wish you were invisible?
Hi,
I think you know the rest.Code:foreach ($_GET as $key => $value) ( )
Thomas





Lol I love it when people reply with the exact same answer only 10 minutes later.![]()
OMFG SitePoint ROXORZ TEH BIG ONE111!
Wish you were invisible?
Originally Posted by Thomas Bialik
and even error's in the transcription
Code:foreach ($_GET as $key => $value) { }
Words are weapons of Mass Destruction.



thanks guys![]()
Bookmarks