search
HomeBackend DevelopmentPHP ProblemAre variables in php case insensitive?

Are variables in php case insensitive?

Jan 04, 2022 pm 05:43 PM
phpvariable

php variables are case sensitive. In php, all variables are case-sensitive, including user-defined ordinary variables and predefined variables such as $_GET, $_POST, $_REQUEST, $_COOKIE, $_SESSION, $GLOBALS, $_SERVER, $_FILES, etc.

Are variables in php case insensitive?

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

1. Case sensitive

1. Variable names are case-sensitive

All variables are case-sensitive, including ordinary variables and $_GET, $_POST, $_REQUEST, $_COOKIE, $_SESSION, $GLOBALS, $ _SERVER, $_FILES, $_ENV and other predefined variables;

Predefined variables are also called super global variables. They can be used in all functions without being declared in advance. used in the domain. Through these predefined variables, you can obtain information such as user session, user operating system environment and local operating system environment.

Note: Predefined variables basically exist in the form of arrays.

2. Constant names are case-sensitive by default and are usually written in uppercase letters

##3. php .ini configuration item instructions are case sensitive

For example,

file_uploads = 1 cannot be written as File_uploads = 1

2. Case insensitivity

1. Function names, method names, and class names are not case-sensitive, but it is recommended to use the same name as when defined

Are variables in php case insensitive?

2. Magic constants are not case-sensitive. It is recommended to use uppercase letters

including: __LINE__, __FILE__, __DIR__, __FUNCTION__, __CLASS__, __METHOD__, __NAMESPACE__.

3. NULL, TRUE and FALSE are not case-sensitive

Are variables in php case insensitive?

4. Type coercion is not size-sensitive Write

including

    (int), (integer) – converted to integer type
  • (bool), (boolean) – converted to Boolean type
  • (float), (double), (real) – Convert to floating point type
  • (string) – Convert to string
  • (array) – Convert to array
  • (object) – Convert to object
Recommended learning: "

PHP Video Tutorial"

The above is the detailed content of Are variables in php case insensitive?. 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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!