# Space of PHP variables is as follows.


- Built in superglobal variables are visible everywhere within a script.

- Constants declared once can be used throughout the script. That is, it can be used both inside and outside the functions.

- A global variable is a variable defined within a script that can be used within a script, but not inside functions.

- Variables defined within a function can only be used within a function.

- Variables create inside functions and declared as static are invisible from outside the function but keep their value between one execution of the function and  the next.

- Variables used in the function are deleted at the end of the function.

 

 

 


# PHP Superglobal list is as follow.


- $GLOBAL: An array of all global variables.

- $_SERVER: An array of server environment variables.

- $_GET: An array of variables passed to the GET method.

- $_POST: An array of variables passed to the POST method.

- $_COOKIE: An array of cookie variables.

- $_FILES: An array of variables related to file uploads.

- $_ENV: An array of variables related to environment variables.

- $_REQUEST: Include $_GET, $_POST, and $_COOKIE as an array of user-entered variables. but, does not include $_FILES since PHP 4.3.0.

- $_SESSION: An array of variables related to session.

 

 

Private comment