A variable is a container for temporarily storing values. These values can be numbers, text, or much more complex data.
PHP has 8 kinds of variables.
These include 4 scalar (single-valued) types-string (character), Integer, floating-point (decimal), and Boolean (true or false);
Two non-scalar (multi-valued) types-arrays and objects, and resources (which you will see when interacting with the database) and null (it is a special type that does not have any values).
============================================================================
PHP Syntax Rules:
1, the name of the variable-also known as its identifier-must start with a dollar sign ($), for example, $name.
2. Variable names can contain combinations of letters, numbers, and underscores, for example, $my _report1.
3. The first character after the dollar sign must be either a letter or an underscore (not a number).
4. The variable names in PHP are case-sensitive. This is a very important rule. This means that $name and $name are distinct variables.
FAQ:
First, you can assign a value to a variable by using the equals sign (=) (also known as the assignment operator).
Second, you can print the variable without quotation marks, or you may print the variable in double quotation marks, but you cannot print the variable within single quotation marks.
============================================================================
"1" The most important consideration when creating variables is to use a consistent naming pattern. Some programmers prefer to use variable names all with lowercase letters, and use underscores to separate words ($first _name); some programmers prefer to use the first capital letters, for example: $FirstName (that is, camel-like spelling).
< span="">
http://www.bkjia.com/PHPjc/742587.html www.bkjia.com true http://www.bkjia.com/PHPjc/742587.html techarticle A variable is a container for temporarily storing values. These values can be numbers, text, or much more complex data. PHP has 8 kinds of variables. These include 4 scalar (single-valued) type characters ...