legohead6 Posted June 14, 2006 Share Posted June 14, 2006 Hi, Like always i was fiddling around with code(this time arrays) and i stumbled apon something cool! put this in a php pahe and upload it to your webserver! its kinda handy[code]foreach($_SERVER as $id => $value){echo "$id: $value<br>";}[/code] Link to comment https://forums.phpfreaks.com/topic/11951-cool-thingy/ Share on other sites More sharing options...
.josh Posted June 14, 2006 Share Posted June 14, 2006 lol you have found the $_SERVER array. yes, lots of useful stuff in there. Link to comment https://forums.phpfreaks.com/topic/11951-cool-thingy/#findComment-45378 Share on other sites More sharing options...
legohead6 Posted June 14, 2006 Author Share Posted June 14, 2006 [!--quoteo(post=383636:date=Jun 14 2006, 12:18 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 14 2006, 12:18 AM) [snapback]383636[/snapback][/div][div class=\'quotemain\'][!--quotec--]lol you have found the $_SERVER array. yes, lots of useful stuff in there.[/quote]ya, i also found $_POST $_GET $_SESSION lol...they all come in handy! Link to comment https://forums.phpfreaks.com/topic/11951-cool-thingy/#findComment-45380 Share on other sites More sharing options...
wildteen88 Posted June 14, 2006 Share Posted June 14, 2006 Everyone uses those all the time in their scripts! These variables are called [a href=\"http://uk2.php.net/variables.predefined\" target=\"_blank\"]Super Globals[/a]. There are also other prefined variables too in PHP. Link to comment https://forums.phpfreaks.com/topic/11951-cool-thingy/#findComment-45418 Share on other sites More sharing options...
poirot Posted June 14, 2006 Share Posted June 14, 2006 ... Which are documented here:[a href=\"http://www.php.net/variables.predefined\" target=\"_blank\"]http://www.php.net/variables.predefined[/a] Link to comment https://forums.phpfreaks.com/topic/11951-cool-thingy/#findComment-45533 Share on other sites More sharing options...
kenrbnsn Posted June 14, 2006 Share Posted June 14, 2006 And a much easier way of dumping any of them or any array (or variable) is[code]<?php echo '<pre>' . print_r($thearray,true) . '</pre>'; ?>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/11951-cool-thingy/#findComment-45571 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.