(01) PHP tagged <?php?>
<? ?>
<%%>
<script lauguage= "PHP" ></scrit>
(02) Output statement
Echo can print multiple values without parentheses
Print has a return value that cannot be printed multiple values
Die () Output and exit the program
Exit () Output and exit the program
printf () Formatted output
sprintf () formatted return
Var_dump () Output all information and content testing
Print_f () Output all information and content testing
(03) Comments///* *
(04) data type int double float string char datetime (TIME) bool
(05) Define the variable $x = ""; Variable must start with $
(06) variable variable $a = "B";
$b = "word";
echo $ $a; The output is Word
(07) Determine if the variable has a value isset ()//null or 0 is false
(08) Clear variable unset ()
(09) Determine if the variable is empty ()
(10) Take the address character &
$a = 5;
$b =& $a;
$b = 10;
echo $a; Output is 10
(11) Output variable information details dump ()
Type name GetType ()
Array information Var_dump (array)
(12) Type conversion cast setType (variable, type)//cast variable to desired type
Type +var ()
(type) + variables such as (int) $a; Turn A into an integral type
Auto-conversion (rule) priority from high to low is floating point > Integer > Boolean, String
Boolean and string are converted to numeric types when the operation
String conversion to numeric type only extracts the beginning of the number, E (+/-) n represents the bottom of the 10 (+/-) n the number of square
(13) stitching strings. such as echo "". $a. ""; The middle of the output is a sentence of variable a
(14) Error suppressor @//Mask off error
Error classification 1.notice 2.warning 3.error where error level is highest
(15) Conditional operator? : Structure: Judging condition? Output when correct: error when output
(16) escape character \ n line break \ r enter \ t Horizontal tabulation
(17) You can parse variables and escape characters in double quotes echo "hello{$a}\" HI "
Single quotation marks do not have the above function, the contents of single quotation marks are generally output as-is
(18) Delimiter definition character channeling $a =<<
(19) PHP Statement Branch Statement switch-case Statement IF-ELSE statement for Loop statement while Loop statement
PHP Simple statement