PHP 问答 02

// HTTP协议中几个状态码的含义:503 500 401 200 301 302。。。

     503:服务器超载|停机维护

     500:服务器内部错误

     401:未授权

     200:成功

     301:持久跳转

     302:临时跳转

 

// HEREDOC 介绍

     print <<<EOT

          html

     EOT;

     

// 向php传入参数的两种方法。

     php -q php.php -f value -p value

     php -q php.php --f value --p vlaue

     argopt();

     $args;

 

// 写代码来解决多进程/线程同时读写一个文件的问题。

     function more_file($file)

     {

          if(!is_file($file)) return ;

          $handle = fopen($handle, 'w');

          if (flock($handle, LOCK_EX)) {

               fwrite($handle, 'this is content');

               flock($handle, LOCK_UN);

          } else {

               return 'error';

          }

          fclose($handle);

     }

 

// Mysql 的存储引擎,myisam和innodb的区别。

   1、两者在文件构成上有区别;

    2、InnoDB支持事务处理,MyISAM不支持;

    3、对无WHERE子句的COUNT(*)操作的不同:MyISAM中保存了该值,直接读取,InnoDB需要作全表扫描;

    4、锁的区别:InnoDB支持表级锁和行级锁,MyISAM只支持表级锁

  

// 介绍xdebug,apc,eAccelerator,Xcache,Zend opt的使用经验。

     xdebug 错误调试信息

 

// 使用mod_rewrite,在服务器上没有/archivers/567.html这个物理文件时,重定向到index.php?id=567 ,请先打开mod_rewrite.

 

// linux下查看当前系统负载信息的一些方法。

     top

 

// vim的基本快捷键。

     :w

     :wq

     :/search

posted @ 2013-05-27 20:26  yiya1995  阅读(205)  评论(0)    收藏  举报