php基础8.24

1.文件上传
RFC1867协议详细介绍:
http://blog.csdn.net/xiaoxiaohai123/article/details/2538857php

<form action="2.php" method="post" enctype="multipart/form-data" >
name:<input type='text' name='user' />   
name:<input type='text' name='password' />   
file:<input type='file' name='zsw' />   
<input type='submit' value="提交"/>
</form>css

表单上传的头:html

image

2.http EXTENSION-----webdav
web

3.xmlrpcrestful

4.restful函数

5.php错误日志记录
   1.记录到指定的文件
   error_log($msg,3,$file)  将日志记录到$file中.post

 1: Class log { 
 2:   // 
 3:   const USER_ERROR_DIR = '/home/site/error_log/Site_User_errors.log'; 
 4:   const GENERAL_ERROR_DIR = '/home/site/error_log/Site_General_errors.log'; 
 5:  
 6:   /* 
 7:  User Errors... 
 8:  */ 
 9:     public function user($msg,$username) 
 10:     { 
 11:     $date = date('d.m.Y h:i:s'); 
 12:     $log = $msg." | Date: ".$date." | User: ".$username."\n"; 
 13:     error_log($log, 3, self::USER_ERROR_DIR); 
 14:     } 
 15:     /* 
 16:  General Errors... 
 17:  */ 
 18:     public function general($msg) 
 19:     { 
 20:     $date = date('d.m.Y h:i:s'); 
 21:     $log = $msg." | Date: ".$date."\n"; 
 22:     error_log($msg." | Tarih: ".$date, 3, self::GENERAL_ERROR_DIR); 
 23:     } 
 24: } 
 25: $log = new log(); 
 26: $log->user($msg,$username); //use for user errors 
2.记录到php.ini指定的目录:
error_log("$str); //默认到指定目录
 
3.写一个函数对于n层函数,用n个glue链接
  $arr=array(array(1,2),array(3,4),array(5,6);
  1-2,3-4,5-6
  实现过程以下:
 
4.void exit ([ string $status ] )
      void exit ( int $status )

If status is a string, this function prints the status just before exiting. this

If status is an integer, that value will be used as the exit status and not printed. Exit statuses should be in the range 0 to 254, the exit status 255 is reserved by PHP and shall not be used. The status 0 is used to terminate

spa

相关文章
相关标签/搜索