Home > Backend Development > PHP Tutorial > PHP predefined variables_PHP tutorial

PHP predefined variables_PHP tutorial

WBOY
Release: 2016-07-21 14:51:35
Original
997 people have browsed it

Let me introduce to you the PHP predefined variables that are often used in PHP learning. Through predefined variables, you can obtain information such as user sessions, user operating system environment, and local operating system environment.

 $_SERVER['SERVER_ADDR'] The IP address of the server where the script is currently running.

 $_SERVER['SERVER_NAME'] The name of the server host where the script is currently running.

 $_SERVER['REQUEST_METHOD'] The request method when accessing the page.

 $_SERVER['REMOTE_ADDR'] The IP address of the user who is browsing the current page.

 $_SERVER['REMOTE_HOST'] The host name of the user who is browsing the current page.

 $_SERVER['REMOTE_PORT'] The port used by users to connect to the server.

 $_SERVER['SCRIPT_FILENAME'] The absolute path of the currently executing script.

 $_SERVER['SERVER_PORT'] The port used by the server.

 $_SERVER['SERVER_SIGNATURE'] A string containing the server version and virtual host name.

 $_SERVER['DOCUMENT_ROOT'] The document root directory where the currently running script is located.

 $_COOKIE Information passed to the script through HTTPCookie. These are set by setcookie() when executing the php script.

$_SESSION contains information about all session variables. The $_SESSION variable is mainly used for session control and value transfer between pages.

 $_POST Parameter information passed through the post method.

 $_GET Parameter information passed through the get method.

 $_GLOBALS An array consisting of all defined global variables. The variable name is the index into the array. It can be called a super set of all super variables.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/371778.htmlTechArticle Let me introduce to you the PHP predefined variables that are often used in PHP learning. Users can be obtained through predefined variables Information such as sessions, user operating system environment and local operating system environment...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template