0

使用 PHP,如何识别字符串是任何文件的路径?

4

2 回答 2

3

http://pt.php.net/is_file

$path = 'string';
if(is_file($path)){
  // look, it's a file!
}
于 2010-05-14T11:05:16.040 回答
1
is_file($filename)
is_dir($filename)

true如果字符串指向现有文件或目录,将返回。

于 2010-05-14T11:05:23.770 回答