"Replace i=i+1 with I+=1." In line with C + + habits, efficiency is high ";
For global variables, you should run out of unset ()
As far as possible to file operations, although the PHP file operation efficiency is not low;
Optimization of the Select SQL statement, as far as possible in the case of INSERT, update operation (on the update, I was bad batch) to achieve the purpose of PHP performance optimization;
Use PHP intrinsics as much as possible (but I'm wasting the time that could have written a custom function to find a function that doesn't exist in PHP, experience problem!);
In the case can be replaced with file_get_contents file, fopen, feof, Fgets and other series of methods, try to use file_get_contents, because his efficiency is much higher! But pay attention to file_get_ Contents PHP version problem when opening a URL file;
Inside the loop, do not declare variables, especially large variables: objects (This is not just a question to be aware of in PHP?);
Multidimensional arrays try not to loop nested assignments;
Do not use regular expressions in cases where PHP internal string manipulation functions are possible;
foreach is more efficient and uses foreach instead of while and for loops as much as possible.
Use single quotes instead of double quotation marks to reference strings for PHP performance optimization;
In multiple nested loops, if possible, the longest loop should be placed in the inner layer, with the shortest loop in the outer layers, thus reducing the number of times the CPU crosses the loop layer to optimize program performance.
http://www.bkjia.com/PHPjc/445982.html www.bkjia.com true http://www.bkjia.com/PHPjc/445982.html techarticle replace i=i+1 with I+=1. In line with the C + + habit, the efficiency is high; For the global variable, you should run out of unset () as much as possible to file operations, although PHP file operation efficiency is not low; Excellent ...