|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-11-18 16:28 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2020-11-18 16:28 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
Description: ------------ I'd love to see a glob_filter() function that filters an array of file paths for those file paths matching a glob, with the same rules used by glob(). This function is needed when a virtual file system (implemented in PHP) should be globbed for files. Signature: glob_filter(array $paths, string $glob[, int $flags = 0]) $paths - an array of file system paths $glob - a glob $flags - the glob() flags Result: an array of matching file system paths Test script: --------------- $input = array( '/css', '/css/reset.css', '/css/style.css', '/js', '/js/script.js', ); foreach (glob_filter($input, '/*/*.css') as $path) { echo $path."\n"; } Expected result: ---------------- /css/reset.css /css/style.css