Home >Backend Development >PHP Tutorial >Predefined variables PHP

Predefined variables PHP

巴扎黑
巴扎黑Original
2016-11-24 10:09:26912browse

$_SERVER: http://www.php.net/manual/zh/reserved.variables.server.php

$_ENV: http://www.php.net/manual/zh/reserved.variables.environment. The data in php

$_POST and $_GET can be obtained through $_REQUEST, but $_REQUEST will be slower than $_GET and $_POST.

$_FILE: File upload, http://www.php.net/manual/zh/features.file-upload.post-method.php only has data when uploading files via POST. Refer to Example #3 on the help page

$_COOKIE and $_SESSION are used for session control.

In addition, if you want to customize the value in $_SERVER, you only need to add some commonly used variables (mostly used in clusters) in fastcgi_params. Add the following codes:

fastcgi_param DB4_USER root;
fastcgi_param DB4_PASS "";
fastcgi_param DB4_HOST localhost;
fastcgi_param DB4_PORT 3306;
fastcgi_param DB4_NAME test;

Then get the current environment variable value in $_SERVER["DB4_USER"] root.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php data operationNext article:php data operation