12.3.1 文件的一些基本操作函数

12.3.1 文件的一些基本操作函数

copy -- 拷贝文件
语法:bool copy ( string source, string dest )
将文件从 source 拷贝到 dest。如果成功则返回 TRUE,失败则返回 FALSE。
unlink -- 删除文件
语法:bool unlink ( string filename )
删除 filename。和 Unix C 的 unlink() 函数相似。如果成功则返回 TRUE,失败则返回 FALSE。
ftruncate -- 将文件截断到给定的长度
语法:bool ftruncate ( resource handle, int size )
接受文件指针 handle 作为参数,并将文件大小截取为 size。如果成功则返回 TRUE,失败则返回 FALSE。
rename -- 重命名一个文件或目录
语法:bool rename ( string oldname, string newname [, resource context] )
尝试把 oldname 重命名为 newname。 如果成功则返回 TRUE,失败则返回 FALSE。

文件内容的基本操作

File_get_contents();
File_put_contents();
Readfile();
File()
本地/远程

test.php

';

echo $arr[20];

你可能感兴趣的:(12.3.1 文件的一些基本操作函数)