public function getHTMLFiles($directory)
    {
        try {
            $dir = new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS | RecursiveDirectoryIterator::NEW_CURRENT_AND_KEY);
            $files = new \RecursiveIteratorIterator($dir);

            $allowedExtensions = ['htm', 'html'];

            $list = [];
            foreach ($files as $file) {
                if (in_array($file->getExtension(), $allowedExtensions)) {
                    // HTML File found
                    $relativePath = str_replace($directory, '', $file->getPathname());
                    $list[] = ltrim($relativePath, '\\/');
                }
            }

            return $list;
        } catch (\Exception $e) {
            return [];
        }
    }
public function getHTMLFiles($directory)
    {
        try {
            $dir = new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS | RecursiveDirectoryIterator::NEW_CURRENT_AND_KEY);
            $files = new \RecursiveIteratorIterator($dir);

            $allowedExtensions = ['htm', 'html'];

            $list = [];
            foreach ($files as $file) {
                if (in_array($file->getExtension(), $allowedExtensions)) {
                    // HTML File found
                    $relativePath = str_replace($directory, '', $file->getPathname());
                    $list[] = ltrim($relativePath, '\\/');
                }
            }

            return $list;
        } catch (\Exception $e) {
            return [];
        }
    }
public function getHTMLFiles ( $ directory ) { try { $ dir = new RecursiveDirectoryIterator ( $ directory , RecursiveDirectoryIterator :: SKIP_DOTS | RecursiveDirectoryIterator :: NEW_CURRENT_AND_KEY ) ; $ files = new \ RecursiveIteratorIterator ( $ dir ) ; $ allowedExtensions = [ 'htm' , 'html' ] ; $ list = [ ] ; foreach ( $ files as $ file ) { if ( in_array ( $ file -> getExtension ( ) , $ allowedExtensions ) ) { // HTML File found $ relativePath = str_replace ( $ directory , '' , $ file -> getPathname ( ) ) ; $ list [ ] = ltrim ( $ relativePath , '\\/' ) ; } } return $ list ; } catch ( \ Exception $ e ) { return [ ] ; } }
Get all HTML files from a zip archive.

@param string $directory

@return array
Get all HTML files from a zip archive .