1, replace i=i+1 with I+=1. It is more efficient to conform to the C + + habit.
2. Use PHP internal function as much as possible. Write your own function before you need to consult the manual to see if there are related functions, otherwise thankless.
3, can use single quotation mark string to use single quote string as far as possible. Single quote strings are more efficient than double quote strings.
4, using foreach instead of while traversing the array. When traversing an array, foreach is significantly more efficient than the while loop and does not need to call the Reset function. The two traversal methods are as follows:
Reset ($arr);
while (the list ($key, $value) = each ($arr)) {
echo "Key: $key; Value: $value <br>n ";
}
foreach ($arr as $key => $value) {
echo "Key: $key; Value: $value <br>n ";
}
The above points have been tested by the author, the deficiencies, please more correct.