private static function getFilesInFolderHelper($strPath)
    {
        // Remove trailing slash if it's there
        if ($strPath[strlen($strPath) - 1] == "/") {
            $strPath = substr($strPath, 0, -1);
        }
        $result = array();
        $dh = opendir($strPath);
        assert($dh !== false); // Does directory exist?
        if ($dh === false) {
            return [];
        }    // if asserts are off

        while (($file = readdir($dh)) !== false) {
            if ($file != "." && $file != "..") {
                if (!is_dir($file)) {
                    array_push($result, $file);
                }
            }
        }
        closedir($dh);

        return $result;
    }
private static function getFilesInFolderHelper($strPath)
    {
        // Remove trailing slash if it's there
        if ($strPath[strlen($strPath) - 1] == "/") {
            $strPath = substr($strPath, 0, -1);
        }
        $result = array();
        $dh = opendir($strPath);
        assert($dh !== false); // Does directory exist?
        if ($dh === false) {
            return [];
        }    // if asserts are off

        while (($file = readdir($dh)) !== false) {
            if ($file != "." && $file != "..") {
                if (!is_dir($file)) {
                    array_push($result, $file);
                }
            }
        }
        closedir($dh);

        return $result;
    }
private static function getFilesInFolderHelper ( $ strPath ) { // Remove trailing slash if it's there if ( $ strPath [ strlen ( $ strPath ) - 1 ] == "/" ) { $ strPath = substr ( $ strPath , 0 , - 1 ) ; } $ result = array ( ) ; $ dh = opendir ( $ strPath ) ; assert ( $ dh !== false ) ; // Does directory exist? if ( $ dh === false ) { return [ ] ; } // if asserts are off while ( ( $ file = readdir ( $ dh ) ) !== false ) { if ( $ file != "." && $ file != ".." ) { if ( ! is_dir ( $ file ) ) { array_push ( $ result , $ file ) ; } } } closedir ( $ dh ) ; return $ result ; }
Helper function for getRecursiveFolderContents.
Returns the list of files in the folder that match a given pattern
Result is an array of strings of form "filename.extension".
Not recursive!


@param string $strPath full path to the folder to be processed

@return array
Helper function for getRecursiveFolderContents . Returns the list of files in the folder that match a given pattern Result is an array of strings of form filename . extension . Not recursive!