note 95200 added to function.glob
| From: | seth at osu1 dot php dot net | Date: | Fri, 18 Dec 2009 00:57:44 +0000 |
| Subject: | note 95200 added to function.glob | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-164098@lists.php.net to get a copy of this message | ||
Thanks Haro!!!
I made this great one liner (and some arrays) from that tip that could be messed with to make even
better.
List all dirs in current dir , list all files and dirnames in the next 3 levels of subdirs (this is
all i needed).
$ins = array("Array","(\n",")\n","[",);
$outs = array("File List","<br /> <p style='font-size:.777em'
id='list'>","<br /> </p>","<br />[");
echo str_replace($ins, $outs, print_r(glob('{**/*,**/**/*,**/**/**/*}', GLOB_BRACE),
TRUE));
Cheers!
----
Server IP: 69.147.83.197
Probable Submitter: 98.209.219.193
----
Manual Page -- http://www.php.net/manual/en/function.glob.php
Edit -- https://master.php.net/note/edit/95200
Del: integrated -- https://master.php.net/note/delete/95200/integrated
Del: useless -- https://master.php.net/note/delete/95200/useless
Del: bad code -- https://master.php.net/note/delete/95200/bad+code
Del: spam -- https://master.php.net/note/delete/95200/spam
Del: non-english -- https://master.php.net/note/delete/95200/non-english
Del: in docs -- https://master.php.net/note/delete/95200/in+docs
Del: other reasons-- https://master.php.net/note/delete/95200
Reject -- https://master.php.net/note/reject/95200
Search -- https://master.php.net/manage/user-notes.php