public function checkFolderIsEmptyOrNot(string $folderName):bool
    {
        $files = array ();
        if ($handle = opendir($folderName)) {
            while (false !== ($file = readdir($handle))) {
                if ($file != "." && $file != "..") {
                    $files [] = $file;
                }
            }
            closedir($handle);
        }
        return ((count($files) === 0) ?  true : false);
    }
public function checkFolderIsEmptyOrNot(string $folderName):bool
    {
        $files = array ();
        if ($handle = opendir($folderName)) {
            while (false !== ($file = readdir($handle))) {
                if ($file != "." && $file != "..") {
                    $files [] = $file;
                }
            }
            closedir($handle);
        }
        return ((count($files) === 0) ?  true : false);
    }
public function checkFolderIsEmptyOrNot ( string $ folderName ) : bool { $ files = array ( ) ; if ( $ handle = opendir ( $ folderName ) ) { while ( false !== ( $ file = readdir ( $ handle ) ) ) { if ( $ file != "." && $ file != ".." ) { $ files [ ] = $ file ; } } closedir ( $ handle ) ; } return ( ( count ( $ files ) === 0 ) ? true : false ) ; }
Check if directory is empty or not
@param string $folderName Directory name
@return bool empty or not
Check if directory is empty or not