Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Are variables case sensitive in php?

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "case-sensitive variables in php". In daily operation, I believe that many people have doubts about case-sensitive variables in php. The editor consulted all kinds of data and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "case-sensitive variables in php". Next, please follow the editor to study!

The php variable is case sensitive. In php, all variables are case-sensitive, including normal user-defined variables and predefined variables such as $_ GET, $_ POST, $_ REQUEST, $_ COOKIE, $_ SESSION, $GLOBALS, $_ SERVER, $_ FILES, and so on.

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

First, case sensitivity 1. Variable names are case sensitive

All variables are case-sensitive, including normal variables and predefined variables such as $_ GET, $_ POST, $_ REQUEST, $_ COOKIE, $_ SESSION, $GLOBALS, $_ SERVER, $_ FILES, $_ ENV, etc.

Predefined variables, also known as superglobal variables, can be used in all scopes without being declared in advance. Through these predefined variables, you can obtain information such as the user session, the environment of the user's operating system and the environment of the local operating system.

Note: predefined variables are basically in the form of arrays.

two。 Constant names are case-sensitive by default and are usually written in uppercase

3. Php.ini configuration item instructions are case sensitive

For example, file_uploads = 1 cannot be written as File_uploads = 1

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

two。 Magic constant is not case-sensitive. Uppercase is recommended.

Include: _ _ LINE__, _ _ FILE__, _ _ DIR__, _ _ FUNCTION__, _ _ CLASS__, _ _ METHOD__, _ _ NAMESPACE__.

3. NULL, TRUE, FALSE are not case sensitive

4. Type casting, case-insensitive

Include

(int), (integer)-convert to integer

(bool), (boolean)-convert to Boolean type

(float), (double), (real)-convert to floating point

(string)-convert to string

(array)-convert to an array

(object)-convert to object

At this point, the study of "case-sensitive variables in php" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report