1, the Str_replace function is faster than the Preg_replace function, but the efficiency of the STRTR function is four times times the Str_replace function.
2, if a string substitution function, can accept an array or character as a parameter, and the parameter length is not too long, then you can consider an extra piece of replacement code, so that each pass argument is a character, rather than write a line of code to accept the array as the query and replace parameters.
3. Use the Select Branch statement: The switch case is better than using more than one if,else if statement.
4. Masking error messages with @ is extremely inefficient and extremely inefficient.
5, open the Apache mod_deflate module, can improve the browsing speed of the page.
6, the database connection should be turned off when used, do not use long connection.
7. Error messages are costly.
8, increment the local variable in the method, the speed is the quickest. is almost equivalent to the speed at which local variables are called in the function.
9, incrementing a global variable is twice times slower than incrementing a local variable.
10, incrementing an object property (such as: $this->prop++) is 3 times times slower than incrementing a local variable.