Parse how to use the PHP function to obtain the current running environment and determine the execution logic. In general, our runtime environment is apache, and of course some people use the IIS environment. if we want to know what the current runtime environment is, then we only need to use functions. In general, our runtime environment is apache, and some people use the IIS environment.
If we want to know what the current running environment is, we only need to use the php_sapi_name () function to test
Comparison and judgment
Function: php_sapi_name ();
The output result in the apache environment is "apache2handler ";
In cgi mode, the output result is "cgi-fcgi"
If it is run in command line mode, the output result is: "cli"
Using apache, of course, some people use the IIS environment. if we want to know what the current running environment is, we only need to use the function...