位置: 编程技术 - 正文
推荐整理分享PHP:rename()的用法_Filesystem函数(php render()),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:php中的require,php中的require,php中require的用法,php中dirname,phpdirname,phpdirname,php rename,php名字,内容如对您有帮助,希望把文章链接给更多的朋友!
(PHP 4, PHP 5)
rename — 重命名一个文件或目录
说明 bool rename ( string $oldname , string $newname [, resource $context ] )尝试把 oldname 重命名为 newname。
参数oldname
Note:
用于 oldname 中的封装协议必须和用于 newname 中的相匹配。
newname新的名字。
contextNote: 在 PHP 5.0.0中增加了对上下文(Context)的支持。有关上下文(Context)的说明参见Streams。
返回值成功时返回 TRUE, 或者在失败时返回 FALSE。
更新日志版本 说明 5.3.1 可以在 Windows 上跨驱动器 rename() 文件。 5.0.0 rename() 也可用于某些 URL 封装协议。参见支持的协议和封装协议 的列表看看 rename() 支持哪些 URL 封装协议。 4.3.3 在有适当权限的时候 rename() 已经能够在基于 *nix 的系统中跨磁盘分区重命名文件。Warnings may be generated if the destination filesystem doesnt permit chown() or chmod() system calls to be made on files — for example, if the destination filesystem is a FAT filesystem.
范例
Example #1 rename() 例子
<?phprename("/tmp/tmp_file.txt","/home/user/login/docs/my_file.txt");?> 参见copy() - 拷贝文件 unlink() - 删除文件 move_uploaded_file() - 将上传的文件移动到新位置
PHP:rmdir()的用法_Filesystem函数 rmdir(PHP4,PHP5)rmdir删除目录说明boolrmdir(string$dirname[,resource$context])尝试删除dirname所指定的目录。该目录必须是空的,而且要有相应的权限。失败时会产生
PHP:set_file_buffer()的用法_Filesystem函数 set_file_buffer(PHP4,PHP5)set_file_bufferstream_set_write_buffer()的别名说明此函数是该函数的别名:stream_set_write_buffer()。
PHP:rewind()的用法_Filesystem函数 rewind(PHP4,PHP5)rewind倒回文件指针的位置说明boolrewind(resource$handle)将handle的文件位置指针设为文件流的开头。Note:如果将文件以附加(a或者a+)模式打开,
标签: php render()
本文链接地址:https://www.jiuchutong.com/biancheng/285174.html 转载请保留说明!友情链接: 武汉网站建设