How to hide this error message "failed to open dir: "?

<?php
$h = opendir("/home/public_html/folder/");

while (false !== ($entry = readdir($h))) {
    if($entry != '.' && $entry != '..') { //Skips over . and ..
        break; //Exit the loop so no more files are read
    }
}
?>
PHP:
I keep getting this: "Warning: opendir(/home/public_html/folder/): failed to open dir: No such file or directory in ..."

How to hide this error message when some folders dont exist? Thanks

from PHP http://ift.tt/1PenwWw
via IFTTT
Previous
Next Post »
Thanks for your comment