1. use i1 to replace ii1. In line with the habit of cc, the efficiency is high. 2. use PHP internal functions as much as possible. Before writing a function, check the manual to see if there are any related functions. 3. try to use a single quotation mark string. The efficiency of a single quotation mark string is higher than that of a double quotation mark string. 4. use foreach instead of while times 1. use I = 1 instead of I = I 1. In line with c/c habits, high efficiency.
2. use PHP internal functions as much as possible. Before writing a function, check the manual to see if there are any related functions.
3. try to use a single quotation mark string. The efficiency of a single quotation mark string is higher than that of a double quotation mark string.
4. use foreach instead of while to traverse the array. When traversing an array, foreach is much more efficient than while loop, and you do not need to call the reset function. The two traversal methods are as follows:
Reset ($ arr );
While (list ($ key, $ value) = each ($ arr )){
Echo "Key: $ key; Value: $ value
N ";
}
Foreach ($ arr as $ key => $ value ){
Echo "Key: $ key; Value: $ value
N ";
}