Chapter 4-basic PHP syntax. 1. the first PHP program ?? 2. PHP supports eight basic data types, including four scalar types: boolean, integer, float, and s 1. first PHP program
2. PHP supports eight basic data types, including four scalar types: boolean, integer, float, and string ), two composite types: array and object. two special types are available: resource and NULL)
3. the var_dump function can be used to print information about variables.
4. integer type.
In 32-bit operating systems, the valid range of integer numbers is-2147483648 ~ + 2147483647. If this range is exceeded, it will be interpreted by the PHP engine as a floating point number (float ).
Add 0 in octal and 0x in hexadecimal notation (0 rather than letter O)
5. string type
There are three methods for defining strings: single quotes ('), double quotes ("), and delimiters (<). The difference between the first two is that if a string contains a variable name, the variable name in double quotation marks will be replaced by the actual value, and the variable name in single quotation marks will be directly output according to common characters.
'"My name, "?>
Use the following delimiters:
6. object type
Name =-> age = 'My name is '.-> name .'
I am '.-> age.' years old '= Person ("kimi", 5->?>
7. type conversion
Print_r ()Displays easy-to-understand information about a variable. If the value is string, integer, or float, the variable value is printed. If array is provided, keys and elements are displayed in a certain format.
" ='Kimi' =() '' ( ='Cindy' =() '
' ( ?>
Why? "? 2. PHP supports eight basic data types, including four scalar types: boolean, integer, float, and s...