1. Concept
Functions declared inside a function are internal functions.
2. Attention when using
(1) After calling the external function, you can call the internal function arbitrarily
(2) Internal functions can be called inside the function, but they must be called after the internal function is defined, because the PHP parser will only load external functions and will not execute external functions, so it does not know that there are internal functions in external functions.
3. Examples
<?php //Get the system time function (note that the uppercase Y in the parameter represents the complete year, and the lowercase y represents the abbreviation of the year) $sum = date("Ymd"); $sum1 = date("ymd"); echo "$sum<br/>"; echo "$sum1<br/>"; //md5 encryption function $pass = md5("Zhang San"); //The output content is the encrypted ciphertext echo $pass; ?>
The above is an introduction to PHP internal functions. I hope it will be helpful to everyone.