Learning routes for PHP learners:
(1) familiar with HTML/CSS/JS, the basic elements of the web, the completion stage can be self-made simple web pages, the element attributes are relatively familiar
(2) Understand the concept of dynamic language and operation mechanism, familiar with basic PHP syntax
(3) Learn how to combine PHP with HTML to complete a simple dynamic page
(4) Contact learning MySQL, start designing database
(5) Constantly consolidate PHP syntax, familiar with most common PHP functions, understand object-oriented programming, MySQL optimization, and some templates and frameworks
(6) Finally complete a full-featured dynamic site
Tips for sharing 10 PHP performance optimizations:
(1) foreach is more efficient and use foreach instead of while and for loops as much as possible
(2) Do not declare variables inside the loop, especially variables such as objects
(3) in multiple nested loops, if possible, the longest cycle should be placed in the inner layer, the shortest loop in the outer layers, thereby reducing the number of cycles across the CPU, optimize program performance
(4) Use single quotes instead of double quotes to reference strings for PHP performance optimizations
(5) Replace i=i+1 with I+=1. In line with C + + habits, high efficiency
(6) Optimization of the Select SQL statement, as far as possible in the case of INSERT, update operation, to achieve the purpose of PHP performance optimization
(7) As far as possible to file operations, although the PHP file operation efficiency is not low
(8) Use PHP intrinsic functions whenever possible
(9) Do not use regular expressions in cases where PHP internal string manipulation functions are available
(ten) feof, Fgets, fopen, in the case can be used file_get_contents alternative file, series of methods, as far as possible to use file_get_contents, because it is much more efficient. But pay attention to the PHP version of file_get_contents when opening a URL file
The above is the PHP learning route and 10 PHP optimization techniques, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!