keyword global:
used to make a function call an external variable, but it is not to make the variable super-global. Instead of 1, a local variable is defined inside the function and the name of the local variable is exactly the same as the name of a global variable outside! 2, copy the address of the value of the outside global variable, pass it to the local variable defined inside the function (use $GLOBALS as much as possible in programming , because it is really defining a super global variable)
Static local variables:
The keyword that defines it is:static
Feature: Each time the function is called, the static local variables will be saved without disappearing (the next time you call it can then be used), but at the end of the function call, it also ends.
Recursive functions:
function itself to call itself;
recursive two elements :
Recursive exit: When to stop yourself calling yourself when you start calling yourself
Recursion point: When do you start calling yourself
(generally write recursive exit and write recursion point)
The iterative idea is to solve the problem from the point of travel, which is embodied in the code, which is actually a repetitive execution of a step, that is, the loop structure.
Time function:
Date: uses the time format placeholder to format the specified timestamp in the form of a corresponding format , such asdate(y) , output, y forthe year.
Strtotime: Converts a time string in an English format to a timestamp!
such as strtotime ("2016-9-10"); is converted into a timestamp
Time function:
Date: uses the time format placeholder to format the specified timestamp in the form of a corresponding format , such as:date(y), Output ,y Represents the year.
Strtotime: Converts a time string in an English format to a timestamp!
such as strtotime ("2016-9-10"); is converted into a timestamp
To create an array:
Explicitly created:
$arr =array (
' key name ' = = ' value ',
Key Name 1 ' = = ' value 1 ',
Key Name 2 ' = = ' value 2 ',
);
Implicitly created:
$arr [' Key name ']= ' value ',
$arr [' Key name 1 ']= ' value 1 ',
$arr [' Key name 2 ']= ' value 2 ',
$arr [' Key name 3 ']= ' value 3 ',
Var_dump ($arr);
Array classification:
1. indexed array: The key of an array element, not the meaning of its value, only the position of the element within the entire array
2. Associative arrays: There is a one by one corresponding relationship between the key and the value of the exponent group element, that is, the key means its value!
PHP Syntax Basics 5