$filename = '/www/test1/*.pdf'; if (file_exists($filename)) { echo "The file $filename exists"; } else { echo "The file $filename does not exist"; }
I used the code above, but it checks the * .pdf file, but not for all files belonging to the .pdf extension
source share