tags:

views:

28

answers:

2

Using PHP, How to identify that the string is a path to any file?

+3  A: 

http://pt.php.net/is_file

$path = 'string';
if(is_file($path)){
  // look, it's a file!
}
acmatos
+1  A: 
is_file($filename)
is_dir($filename)

Will return true if the string points to an existing file or directory.

sshow