sql - PHP clarifation of file_exists function, does it check for the actual file or just a path -
i have list of txt file names , paths in sql db. have directory contains few files (a lot of links bad links). i'm using:
$filename = '/path/somename.txt'; if (file_exists($filename)) { echo "the file $filename exists"; } else { echo "the file $filename not exist"; } to check file, i'm noticing it's coming if file there. there better alternative function i'm trying do, or doing else wrong. thank in advance!
file_exists should validate file exists, not path file exists.
if you're having problems might try including document root in path.
Comments
Post a Comment