[Phpwm] unlinking files

Kevin Golding php at caomhin.demon.co.uk
Fri Sep 29 12:00:23 BST 2006


Someone, quite probably Rob Allen, once wrote:
>I've just checked our library code and we do:
>
>if (is_file($form_field_file) && !is_dir($form_field_file))
>{
>    // do stuff
>}
>
>
>I wonder what the difference between file_exists() and is_file()
>actually is?!

is_file() should return false for a directory, whereas file_exists()
would return true for a directory.

So basically:
 is_file() == ( file_exists() && !is_dir() ) 

Kevin



More information about the Phpwm mailing list