What are common PHP functions, some examples of PHP custom functions, callback functions, variable functions and recursive functions, and the use of PHP global variables and local variables, static functions, and so on. PHP function Language structure: if () for () while () switch () echo () print () array () list () foreach () isset () unset () empty () exit () Die () include () Require () Custom functions: function Fun () {}1. Call function Fun () ";} echo "";} JIUTB (9, "#cccccc"); Jiutb (Ten, "Red");? >Default parameters: function Jiutb ($num =9, $color = "Black") {}2. Variable parameters 3, the sum of the infinite number of parameters: 4. Variable function function Fun () {} $a = ' fun '; $a (2,3,4,5);Variable scope: 1. Variables outside the global variables function 2. Variables inside a local variable function glocal keyword modification to change local variables to global variables Reference parameter: 1, inside and outside the function point to the same address callback function: is one of the parameters. The parameter of a function is the name of another function, so this parameter is called the callback function Static variables call the same function multiple times, and static variables can be tracked down. This function was called several times when the program was called. ";} Show (); show ();? >Static Variable method: ";} Show (); Show (); Show (); >File contains: 1.include () contains error, script continues to execute 2.require () the script terminates immediately if it contains an error Recursive function: Function inside call this function 1. Sum: Recursive function $num=100;for ($i =1; $i <= $num; $i + +) {$sum + = $i;} Echo $sum;The order in which functions are called Show (); function Show () {}show ();6.php execution order 1, Load page 2, syntax detection (1. Syntax detection 2. Load function) 3, execute script |