[PHP Basics] PHP superglobals

PHP superglobals Summary:

Form 1. $ _ GET // submitted by GET (method = "get") mode, and URL +? Way to pass value

Form data 2. $ _ POST // submitted by method = "post" mode

3. $ _ SERVER // get server information

4 $ _ COOKIE // session one kind of technology, the data stored in the client

5. $ _ SESSION // one kind of session technique, data is stored on the server will

6. $ _ FILE // Get upload file information

7. $ GLOBALS // storage superglobals and global variables, the interior contains $ _GET / $ _POST / $ _COOKIE / $ _ FILE / GLOBALS, attention: $ _ GLOBALS remember playing more than twice globals globals globals $ _GLOBALS $ _GLOBALS

 

$ _SERVER common variable (note required)

 

$_COOKIE

Assignment: setcookie ( "cookieNmae", "cookieValue", expiration date); 

Value: $ _ COOKIE [ 'cookieName'];

Delete: set the expiration time time () - 999999; minus -1 to delete

 

 

$_SESSION

 

 Must open session session session_start () when using session;

1. Delete the destruction of the two-step session unset () 2.session_destroy () delete the session file

session: General storage path D: \ phpstudy \ myphp_www \ PHPTutorial \ tmp \ tmp (phpstudy Environment)

 

$_GLOBALS 

$ _GLOBALS store global variables and superglobals, directly on the map

 

·············································分割线······················································

 

 

 

 

 引用可直接改变全局变量的值

 

$_FILES

 

 获取上传文件的相关信息,注意:$_FILES是一个二维数组

 

 error 错误状态码

 

 

Guess you like

Origin www.cnblogs.com/baboben/p/11962817.html
php