function isEmptyDir( $path ) { $dh= opendir( $path ); while(false !== ($f = readdir($dh))) { if($f != "." && $f != ".." ) return true; } return false; }