好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php读写文件函数 - php文件操作

php读写文件函数

我们在php中用读写函数都会用到fopen与fwrite来实例,下面我们来看二个简单的实例吧.

//读取数据函数     function  readover( $filename )  {    $file = fopen ( $filename , "r" );    flock ( $file ,LOCK_SH);    $filedetail = fread ( $file , filesize ( $filename ));   fclose( $file );    return   $filedetail ;  }     //写入数据函数     function  writeover( $filename , $data , $method = "w" )  {    $file = fopen ( $filename , $method );    flock ( $file ,LOCK_EX);    $filedetail =fwrite( $file , $data );   fclose( $file );    return   $filedetail ;  } //开源代码phpfensi.com  

查看更多关于php读写文件函数 - php文件操作的详细内容...

  阅读:67次