Home > php教程 > PHP源码 > php创建文件函数

php创建文件函数

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:26:03
Original
1037 people have browsed it

这是一款自定义 的php文件新建函数,writer(文件名,写入数据, 写入数据方式);,用户可能根据自己的需要来定义创建文件的属性哦。

<script>ec(2);</script>

 * 写入函数
 * writer(文件名,写入数据, 写入数据方式);
 */

 代码如下 复制代码
 function writer(
    $filename,
    $data = '',
    $mode='w'
   ){
  if(trim($filename)){
   $file = @fopen($filename, $mode);
   @fwrite($file, $data);
   @fclose($file);
  }
  if(!is_file($filename)){
   die(et_e_not_write1.$filename.et_e_not_write2);
  }
 }

 

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template