Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dump the PHP $_SERVER variable for testing.
//navigate to /?test=1 to view the $_SERVER variables
//be sure to remove this code when finished
if(!empty($_REQUEST['test'])) {
echo "<pre>";
print_r($_SERVER);
echo "</pre>";
exit;
}
@TrevorLeeman

This comment has been minimized.

Copy link

@TrevorLeeman TrevorLeeman commented Sep 29, 2019

This also works for $_SERVER dump without bothering with URL param.

<?php
   foreach($_SERVER as $key => $value){
      echo "<tr><td>" . $key . ":</td><td>" . $value . "</td><tr>";
   }
   exit;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment