PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<parse_ini_filepclose>
Last updated: Mon, 16 Jul 2012

pathinfo

(PHP 4 >= 4.0.3, PHP 5)

pathinfo -- 返回文件路径的信息

说明

array pathinfo ( string path )

pathinfo() 返回一个结合数组包含有 path 的信息。包括以下的数组单元:dirnamebasenameextension

例子 1. pathinfo() 例子

<?php

$path_parts
= pathinfo("/www/htdocs/index.html");

echo
$path_parts["dirname"] . "\n";
echo
$path_parts["basename"] . "\n";
echo
$path_parts["extension"] . "\n";

?>

将输出:

/www/htdocs
index.html
html

注: 有关取得当前路径信息的说明,请阅读预定义变量一章。

参见 dirname()basename()parse_url()realpath()




<parse_ini_filepclose>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST