[php]phpの向上効率

3668 ワード

    1、           static,      static,         4 。

  2、$row[’id’]     $row[id] 7 。

  3、echo   print  ,    echo     (  :         )       ,  echo $str1,$str2。

  4、   for           ,             ,    foreach  。

  5、               ,      。

  6、      __get,__set,__autoload。

  7、require_once()    。

  8、include           ,      PHP include_path        ,                。

  9、            (  :            )   ,  $_SERVER[‘REQUEST_TIME’]   time()。

  10、               。

  11、str_replace   preg_replace   , strtr      str_replace     。

  12、           ,            ,         ,               ,             ,              		         。

  13、        (  : switch case)      if,else if  。

  14、 @             ,    。

  15、  apache mod_deflate  ,           。

  16、              ,      。

  17、        。

  18、          ,      。                  。

  19、                   2 。

  20、        ( :$this->prop++)           3 。 

    21、                            9 10 。

  22、                  ,       (              )。PHP              。

  23、                   ,   (           )   10   ,        。

  24、                          。

  25、            ,           7 8          。                15          。

  26、Apache    PHP             HTML   2 10 。      HTML  ,    。

  27、        ,               。    PHP          25% 100%   ,       。

  28、     ,   memcached。memcached               ,       Web    ,       。     (OP code)      ,                。

  29、                       ,        strlen()  。          ,         ,    zval   (C       ,    PHP  )           。  ,  strlen()   ,        ,             ,      (  :       ,PHP         )、    ,             。      ,     isset()           。

   :

     if (strlen($foo) < 5) { echo “Foo is too short”$$ }

     (         )

     if (!isset($foo{5})) { echo “Foo is too short”$$ }

       isset()   strlen() ,         ,isset()        ,                    。    ,                         。

  30、     $i       ,$i++  ++$i   。     PHP   ,         ,         C Java            ,   。++$i         3   (opcodes),$i++   4   。                ,           。             。          ,  Zend PHP        。                ,                       ,                        (ISPs)    。

  31、         (OOP),          ,                 。

  32、              ,      。

  33、          ,                 ?

  34、     ,           。

  35、       PHP    。

    36、               ,      C         。

  37、    (profile)    。       ,              。Xdebug          ,                 。

  38、mod_zip   Apache  ,          ,          80%。

  39、    file_get_contents  file、fopen、feof、fgets         ,   file_get_contents,         !     file_get_contents     URL     PHP    ;

  40、          ,  PHP           ;

  41、  Select SQL  ,             Insert、Update  ( update ,     );

  42、      PHP    (        PHP        ,                  ,     !);

  43、          ,      :  (      PHP         ?);

  44、              ;

  45、    PHP             ,        ;

  46、foreach    ,   foreach  while for  ;

  47、              ;

  48、“ i+=1  i=i+1。  c/c++   ,    ”;

  49、 global  ,     unset() ;