function check_empty_folder ( $folder ) {
$files = array ();
if ( $handle = opendir ( $folder ) ) {
while ( false !== ( $file = readdir ( $handle ) ) ) {
if ( $file != "." && $file != ".." ) {
$files [] = $file; }
} closedir ( $handle ); }
return ( count ( $files ) > 0 ) ? FALSE : TRUE; }
PHP check folder if empty
Previous post: PHP one line IF statement
Next post: How to make text disappear inside a textbox on focus with JavaScript