The second stage of PHP is to learn the basic syntax of php. The second stage is the basic syntax.
Basic php syntax
Output statement: A. echo output: multiple strings can be output, separated by commas
B. print Output: Only one string can be output. true or false is returned.
C. print_r (): the string and number can be simply printed out, while the Array is displayed in the form of an enclosed key and a list of values, and starts with Array.
D. var_dump: output type
Data Type: A. Weak Language
B. gettype ()
C. Judge type is _ type name ()
Variable definition: A. $ variable name = Value
B. Super global variable $ GLOBALS
C. Variable
D. Is the isset () variable defined?
E. unset () variable clearing
F. empty () determines whether the variable is null.
G. & get address
Type conversion: A. (Data Type) Variable
B. type conversion settype (variable name, type)
Operator expressionA: mathematical operators
B: String: the concatenation string uses.
C: comparison operator
D: logical operator and & or |
E: Others: @ logical control operator
? Ternary Operators
Statement: Branch statement: a. if... else
B. switch... case
Loop a.
B. while
FunctionDefinition
Elements B
C usage
D common random number generator rand ()
Take the current time ()
Date ()
Strtotime () converts an event to a UNIX Timestamp
Set the time zone date_default_timezone_set ('prc ')
Date. timezone = Europe/Paris changed to Etc/GMT-8
Format time date ()