Process Control:
I. Branching structure
If...elseif...elseif...elseswitch...case...break
Two. Cycle control
For
While
Three. Abort the loop
End this layer loop
Break
End this cycle
Continue
Four. Abort the script
Exit ();
Die ();
Function:
Language structure
Custom functions
Parameters
Default parameters
function return value
Variable number of parameters
Variable function
Variable scope
Reference parameters
callback function
static variables
file contains
Recursive functions
Function Classification:
Custom functions
callback function
Variable function
Recursive functions
Language structure:
if ()
for ()
while ()
Switch ()
Echo ()
Print ()
Array ()
List ()
foreach ()
Isset ()
Unset ()
Empty ()
Exit ()
Die ()
Include ()
Require ()
Custom functions:
function Fun () {}
Call Function:
Fun ();
Parameters:
Fun (3, "red");
Default parameters:
Function Show ($num =9, $color = "Red") {echo $num; Echo $color; } The result of the function: 1. Output 2. Returns the result variable number of parameters: 1.func_get_args (); 2.func_num_args (); Variable function: $a = "sum"; $a (); Variable scope: 1. Variables outside the global variables function are global variables 2. Variables inside a local variable function are local variables the Global keyword is modified to make the local variable reference parameter: 1. The inside and outside of the function points to the address of the same variable, changing the value of the variable inside the function, Outside of the function, the callback function is also changed: the parameter of 1 function is the name of another function, then this parameter is called the callback function; Static variables: Multiple calls to the same function, static variables can be tracked down
The file contains:
Include () contains an error script to continue execution
Require () If the error file aborts execution
Recursive functions:
function to call this function, from top to bottom to see the code
This article is from the "Gavin" blog, make sure to keep this source http://gavinsw.blog.51cto.com/3097149/1761680
20160408-php Process Control and functions