PHP elements of learning skills and learning

1, for PHP learners roads:

  (1) understanding of HTML / CSS / JS ,, fundamental elements of the page, complete phase can be made simple pages themselves, to understand the relative characteristics of the elements

  (2) understand the concept of dynamic speech and transport to do mechanisms to understand the underlying PHP syntax

  (3) Learn how to combine PHP with HTML, complete simple dynamic pages

  (4) touch learn MySQL, began to design database

  (5) continuously stable PHP syntax, PHP understand most of the commonly used functions, understand object-oriented programming, MySQL optimization, as well as some of the templates and structure

  (6) after completion of a thorough function of dynamic site ( hanjiaLi )

  2, enjoy 10 PHP function optimization tips:

  (1) foreach higher power, try to use foreach Alternatively loop while and for

  (2) inside the loop do not declare variables, in particular variables such as target

  (3) in a multiple nested loops, if perhaps, should be placed in the inner loop the longest, shortest cycles on the outer and reduce the number of cpu cycles cross-layer optimizer function

  (4) in single quotes cited alternative double quotes PHP to achieve optimization function

  (5) alternate with i + = 1 i = i + 1. In line with c / c ++ habits, power is also high

  (6) optimization Select SQL sentence, carried out Insert as little as possible in perhaps the case, Update operation, ( mountaingreataLu ) PHP function to optimize the intention of arriving

  (7) try to be less file operations Although PHP file operations nor low power

  (8) may make use of PHP internal function

  (9) In the case of using PHP can be internal string manipulation functions, do not use a regular expression

  (10) feof, fgets, fopen , can be used in the case where File file_get_contents Alternatively, the series process, with file_get_contents possible, because it much higher power. But pay attention to gender issues in file_get_contents open a file URL division of PHP version

Guess you like

Origin www.cnblogs.com/lannyQ-Q/p/12189734.html