NYCPHP Meetup

NYPHP.org

[nycphp-talk] file_exists()

tedd tedd at sperling.com
Sat Jan 7 21:02:08 EST 2006


>Guys,
>
>I have linked directory in my base directory and i have tried the 
>physical path to the files too, however file_exists always returns 
>false.
>
>if i ls the dir and grep for the filename it is there
>
>any ideas why this would happen?
>
>--
>Joseph Crawford Jr.

Joesph:

Are you sure about the path? Try writing a file and then check if it's there.

<?php
$filename = '/path/to/foo.txt';

if (file_exists($filename)) {
     echo "The file $filename exists";
} else {
     echo "The file $filename does not exist";
}
?>


tedd
-- 
--------------------------------------------------------------------------------
http://sperling.com/



More information about the talk mailing list