Getting Started with PHP: HTTP://WWW.IMOOC.COM/LEARN/54
3-2 How to define variables
The "Var_dump" function displays the data type of our variables (described later in the section).
<? php $var _name=" Apple "; $n=var_dump ($var _name); var_dump ($n);? >
Output:
String (6) "Apple"
Int (10)
3-3 naming conventions for variable names
1. Variable names must begin with a letter or underscore "_", such as "$_name", "$name", "$name 2", etc., but "$9name" is not correct.
2, the variable name can only be composed of letters, numbers, and "_", but also contain Chinese characters. such as "$_qq", "$QQ 308", "$my _apple", "such as" $name I Wait ", but" $name * "is wrong.
3. Variable names are not allowed to contain spaces. When the variable name consists of multiple words, it is recommended to use "_" to separate (for example $my _apple), commonly known as the underscore method, or start with a capital letter such as $myApple, commonly known as camel-named (also known as the Hump name).
In particular, it is important to note that in PHP variable names are case-sensitive , such as "$my _book" and "$my _book" represent two different variables.
PHP Web Tutorial