PHP Global Variables with Example

PHP Global Variables with Example


Global Varibales are "Superglobals"  which can be accessed anywhere in your script, whether inside or outside a any function, class or file without having to do anything special.

The PHP superglobal variables are:

  • $GLOBALS
  • $_SERVER
  • $_REQUEST
  • $_POST
  • $_GET
  • $_FILES
  • $_ENV
  • $_COOKIE
  • $_SESSION