(01) PHP tagged <?php?>
<? ?>
<%%>
<script lauguage= "PHP" ></scrit>
(02) Output statement echo "", "", ""//Can output multiple
Print ""//Output only one
(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 ()
(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 a number type only extracts the beginning of the number, E is 10 as the bottom of the multi-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
(15) Conditional operator? : Structure: Judging condition? Output when correct: error when output
(16) escape character \ n line break \ r enter \ t Horizontal tabulation
(17) The variable echo "hello{$a}hi" can be parsed in double quotes
(18) Delimiter definition character channeling $a =<<
50th Day class PHP basic syntax