本文的copyright归yuweixian4230@163.com 所有,使用GPL发布,可以自由拷贝,转载。但转载请保持文档的完整性,注明原作者及原链接,严禁用于任何商业用途。
作者:yuweixian4230@163.com
博客:yuweixian4230.blog.chinaunix.net
- <?php
-
//获取路径的文件名 basename
-
$path = "./users.txt";
-
printf("filename:%s
",basename($path));
-
printf("filaname sans extension:%s
",basename($path,".txt"));//忽视后缀
-
-
//获取路径的目录 dirname
-
$path = "/usr/loacl/apache/htdocs/users.txt";
-
printf("directory path:%s
",dirname($path));
-
-
//确定绝对路径 realpath
-
$path = "./users.txt";
-
printf("absolute path:%s
",realpath($path));
-
-
//了解更多关于路径的信息 pathinfo
-
$pathinfo = pathinfo("/usr/loacl/apache/htdocs/users.txt");
-
printf("dir name is:%s
",$pathinfo[dirname]);
-
printf("base name is %s
",$pathinfo[basename]);
-
printf("extension:%s
",$pathinfo[extension]);
-
-
//确定文件的大小 filesize(string filename)
-
//计算磁盘的可用空间 float disk_free_space(string directory)
-
//计算磁盘的总容量 float disk_total_space(string directory)
- //确定文件的最后访问时间 int fileatime(string filename)
//确定文件的最后改变时间 int filectime(string filename)
//确定文件的最后修改时间 int filemtime(string filename)
-
?>
- filename:users.txt
-
filaname sans extension:users
-
directory path:/usr/loacl/apache/htdocs
-
absolute path:/usr/local/apache/htdocs/users.txt
-
dir name is:/usr/loacl/apache/htdocs
-
base name is users.txt
-
extension:txt
阅读(861) | 评论(0) | 转发(0) |