The 1.PHP data type is a dynamic type, which determines the type automatically by the value it stores, the type can be transformed, and the variable type is not specified when declaring a variable.
2.define function definition constant variable all uppercase (convention)
3. Use constant variable constants the front of the variable does not require a drug plus $ symbol.
4. Variable types can be tested and reset
5.switch can support int, float, string. (A wide range than A/C + +)
6. Whitespace characters in a string variable assignment value (a newline space tab) are saved in a WYSIWYG way, such as:
$var = "This sentence have
Lines. "
Here, the string variable $var contains a newline character, which is not the same as C + +. In C + +, the value of the string variable to
A newline must use the escape symbol \ n, and the line break on the writing must be added ' \ ' at the end of each line, but not as seen
The way to store
7.bool define (String $name, mixed $value [, bool $case _insensitive = false] Fixed
You can use either a variable or another constant value or a literal.
8. It is best not to enclose the variable in double quotation marks when the variable is connected to the string, which reduces complexity, maintains consistency, and ensures correctness.
9.when a dot is used at the beginning or end of a character class, it loses it special wildcard meaning and becomes just a literal dot.
10.php built-in functions are available in all script, and custom functions are only valid for files defined by a function, to use a custom function in multiple script, you should
Put it in a file and then use require or include.
11. When you need to use the variables contained in the file, just declare the corresponding variables before you include the declaration. This is because the included effect is equivalent to removing the PHP tag at the beginning and end of the included file, and then all the content
Write to the include file.
12. Definitions of functions in the same file can be placed after use