note 112052 added to function.glob

From: Date: Fri, 26 Apr 2013 10:26:05 +0000
Subject: note 112052 added to function.glob
Groups: php.notes 
Request: Send a blank email to php-notes+get-194637@lists.php.net to get a copy of this message
Recursive glob for PHP>=5.5 function globRecursive($path, $find) { $dh = opendir($path); while (($file = readdir($dh)) !== false) { if (substr($file, 0, 1) == '.') continue; $rfile = "{$path}/{$file}"; if (is_dir($rfile)) { foreach (globRecursive($rfile, $find) as $ret) { yield $ret; } } else { if (fnmatch($find, $file)) yield $rfile; } } closedir($dh); } ---- Server IP: 80.64.47.13 Probable Submitter: 84.127.234.73 ---- Manual Page -- http://php.net/manual/en/function.glob.php Edit -- https://master.php.net/note/edit/112052 Del: integrated -- https://master.php.net/note/delete/112052/integrated Del: useless -- https://master.php.net/note/delete/112052/useless Del: bad code -- https://master.php.net/note/delete/112052/bad+code Del: spam -- https://master.php.net/note/delete/112052/spam Del: non-english -- https://master.php.net/note/delete/112052/non-english Del: in docs -- https://master.php.net/note/delete/112052/in+docs Del: other reasons-- https://master.php.net/note/delete/112052 Reject -- https://master.php.net/note/reject/112052 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#194637) next »