Home >Backend Development >PHP Problem >What are the commonly used superglobal variables in PHP?

What are the commonly used superglobal variables in PHP?

藏色散人
藏色散人Original
2020-06-30 09:57:545783browse

The commonly used superglobal variables in php are: 1. "$GLOBALS"; 2. "$_SERVER"; 3. "$_GET"; 4. "$_POST"; 5. "$_FILES"; 6 , "$_COOKIE"; 7. "$_SESSION"; 8. "$_REQUEST".

What are the commonly used superglobal variables in PHP?

Superglobal variables were introduced in PHP 4.1.0 and are built-in variables that are always available in all scopes.

Commonly used super global variables in php

Super global variables: $GLOBALS, $_SERVER, $_GET, $_POST, $_FILES, $_COOKIE, $ _SESSION, $_REQUEST, $_ENV.

Many predefined variables in PHP are "superglobal", which means they are available throughout the entire scope of a script. They can be accessed within a function or method without executing global $variable;.

Please check the relevant manual content of super global variables for details: https://www.php.cn/php/php-superglobals.html

The above is the detailed content of What are the commonly used superglobal variables in PHP?. For more information, please follow other related articles on the PHP Chinese website!

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