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

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -