Blogger Information
Blog 25
fans 0
comment 1
visits 21969
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP文件目录操作补充
潜轲的博客
Original
773 people have browsed it
  1. fopen() 路径,打开状态,建议用a+追加写, w+是清空写,r+必须有原文件。

  2. fwrite($handle,$str)

    可以使用file_put_contents代替以上两个,即写入文件。

  3. 重命名文件

    rename(原名字,新名字) 

    如果新名字中包含中文需进行转码,否则会乱码,因为当前文件为utf-8,windows为gbk

    $newname = iconv('utf-8','gbk',$newname);

  4. 拷贝文件

    copy函数

    copy($file,$dstfile);

  5. unlink($file)

    删除文件

    rmdir移除目录,但只能移除空目录

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post