fclose():关闭文件 fclose() 函数用于关闭已打开的文件。
语法:
bool fclose(resource $handle);参数说明:
示例:
$file = fopen('test.txt', 'r');
// 读取文件内容
fclose($file);unlink():删除文件 unlink() 函数用于删除文件。
语法:
bool unlink(string $filename [, resource $context ]);参数说明:
示例:
unlink('test.txt');copy():复制文件 copy() 函数用于将一个文件复制到另一个文件。
语法:
bool copy(string $source, string $dest [, resource $context ]);参数说明:
示例:
copy('test.txt', 'test-copy.txt');rename():重命名文件 rename() 函数用于重命名文件。
语法:
bool rename(string $oldname, string $newname [, resource $context ]);参数说明:
示例:
rename('test.txt', 'new-test.txt');原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。