One, function assignment problem
function Add ($num 1, $num 2=5) { echo $num 1+ $num 2; } Add (5,19);Second, global variables
- Add a variable to the global variable array
- When invoked: $GLOBALS [' global variable name '];
- In a function called global variables requested in the global, you want to use global declaration in the function, for example:
Third, static variables
- A local variable is revoked when the function exits, but the static variable does not, and the value is preserved when the function is called again.
Iv. include, include_once, require, require_once
- Include: can make multiple calls, error, and then continue to execute.
- Include_once: can only be called once and is no longer executed if it has been previously called.
- Require: The difference from include in the event of an error will stop at the point of error.
- Require_once: The difference with include_once is that the error will stop.
PHP Basics 2