PHP Super Global variables, $_post, $_get, $_server, $_request, etc. ~ ~ ~
I want to know how these super global are generated, when generated, and how they work.
Who knows, tell me about it.
Reply content:
PHP Super Global variables, $_post, $_get, $_server, $_request, etc. ~ ~ ~
I want to know how these super global are generated, when generated, and how they work.
Who knows, tell me about it.
A significant portion of these variables is the one that Web server passes to PHP
In the case of Nginx, when a request comes over, Nginx first looks at how the configuration file is defined to pass some values to fastcgi (nginx configuration file fastcgi_params is for this purpose)
When Nginx initializes these variables, it passes them through the fastcgi port to PHP, and most of these variables can be seen in the $_server.
Of course, Nginx will also send the request sent by the client to the PHP fcgi to process, PHP itself will parse these requests to get $_get and $_post and other variables inside the value.
It's because PHP is doing things for us by default, so it's so easy to use PHP to do web programs-and because of that, it's causing the overflow of the PHP framework.
At first, please refer to http://www.slideshare.net/laruence/th ...
All the super global variables should is generated in the rinit process.
The so-called global is the variable that exists in any program's life cycle, PHP is born.
But these variables are only natural, their life cycle is no different from normal global, just a lot of system-level data will write them, and developers call directly.
It can be considered as a contract between the system and the developer.
This is a very good question, from the previous several answers to learn a lot, thank you. Thinking deeply about this problem can deepen the understanding of PHP.
The so-called super-estimate refers to these variables are more special.
Global variables should be used with caution
Is it possible to learn StackOverflow's community wiki function?