Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 PHP,如何识别字符串是任何文件的路径?
http://pt.php.net/is_file
$path = 'string'; if(is_file($path)){ // look, it's a file! }
is_file($filename) is_dir($filename)
true如果字符串指向现有文件或目录,将返回。
true