php - How to catch any file recursively -
the following code catches files recursively in php extension.
$paths = new \recursiveiteratoriterator(new \recursivedirectoryiterator($realpath), \recursiveiteratoriterator::self_first); $files = new \regexiterator($paths, '/\.(?:php)$/', \regexiterator::match); foreach($files $file){ ...
i want files extension. want replace it: '/\.(?:php)$/'
wouldn't change
/\.(?:php)$/
to
/.*/
Comments
Post a Comment