Home  >  Article  >  Backend Development  >  Are php variable names case sensitive?

Are php variable names case sensitive?

青灯夜游
青灯夜游Original
2019-10-10 15:08:104904browse

PHP is a popular programming language, especially widely used in the web direction. So is PHP's variable naming sensitive to size? The real answer is: PHP variable naming is case-sensitive.

Are php variable names case sensitive?

PHP variable names are case-sensitive, but classes, functions, built-in structures, and keywords are not case-sensitive.

The following is a practical demonstration that PHP variable names are case-sensitive.

Create a new PHP document and declare a variable$stu='jack';

Are php variable names case sensitive?

Name a header again Variables with capital letters (this way of writing variables is not recommended, here is to demonstrate the problem), example: $Stu = 'Smith';

Are php variable names case sensitive?

##passed The above two definitions have resulted in two variables with different capitalization and the same name. Let’s print out the two variables. Example:

echo '小写的$stu的值为:'.$stu;
echo &#39;<br />&#39;;
echo &#39;大写的$Stu的值为:&#39;.$Stu;

Are php variable names case sensitive?

Save the above Content, preview in the browser, if the values ​​of the two output variables are different, it means that variable names in PHP are case-sensitive, and the implementation proves that it is indeed case-sensitive

Are php variable names case sensitive?

The above is the detailed content of Are php variable names case sensitive?. 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