1. Two ways of marking and annotation
Single-line Comment
/* Multiline Comment */
2. Output statement
echo Output:echo can output multiple strings, separated by commas
Print output: Print can output only one string, which returns TRUE or False
Print_r (): You can simply print the string and the number, and the array is displayed in the enclosed key and the list of merit, and in array
Var_dump (): Output Variable type information
3. Data type definition variables
3.1 PHP is a weak type, the variable does not have a definite type
Definition: $ variable name = value; The $ variable name is whole and requires an overall operation
Data types in PHP are reflected in the values
$a = 10;
$b = "he{$a}llo";
$c = ' world ';
1. Double quotation mark inside can parse escape character, single quotation mark not
2. Double quotation mark inside can parse variable, single quotation mark not
3.2 Third definition string, output full content, no escape characters, etc.
$d = <<<aa
Hello "AA", "BB", ' CC ',
<input type= "text" value= "AA"/>
aa;*/
3.3 $e = $a. $c; Stitching strings with the.
3.4 Data type conversion, not strong, PHP is a weak type, you have become the past
$f = 10.05;
$f = (string) $f; Type conversions
$f = "Hello";
3.5 The concept of variable variables
$AA = "CC";
$CC = "DD";
echo $ $AA; Variable variable
$DD = & $aa; & Take Address
$DD = "ee";
Echo $aa;
4, operator, expression
Relational operators: +-*/% + +--+ = =
Comparison operators:> < >= <= = = =!
Logical operators: and && or | | !
echo @ $c; The error suppressor @ does not suppress all
5. Statements
Branch:...
Cycle:...
PHP Basic Syntax