# 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.
'Web > PHP' 카테고리의 다른 글
Space of PHP variables and PHP superglobal list. (0) | 2017.11.21 |
---|---|
이클립스와 PHP 플러그인 연동하는 방법 (0) | 2016.11.22 |
PHP 변수의 범위와 수퍼글로벌의 전체 리스트 (0) | 2016.11.20 |
윈도우7(Windows7)에서 아파치(Apache) 및 PHP 설치 - 2 (2) | 2016.10.30 |
PHP Thread Safe, Non Thread Safe 방식의 차이 (0) | 2016.10.30 |
PHP 태그 스타일 (0) | 2016.10.24 |