Returns an array of all nested JSON files within a given directory.
Parameters
$dir
stringrequired- The directory to recursively iterate and list files of.
Source
private static function recursively_iterate_json( $dir ) {
$nested_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $dir ) );
$nested_json_files = iterator_to_array( new RegexIterator( $nested_files, '/^.+\.json$/i', RecursiveRegexIterator::GET_MATCH ) );
return $nested_json_files;
}
Changelog
Version | Description |
---|---|
6.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.