note 83287 added to function.glob
| From: | heavyraptor at gmail dot com | Date: | Mon, 19 May 2008 11:56:50 +0000 |
| Subject: | note 83287 added to function.glob | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139517@lists.php.net to get a copy of this message | ||
glob() (array_sum() and array_map() in fact too) can be very useful if you want to calculate the sum
of all the files' sizes located in a directory:
<?php
$bytes = array_sum(array_map('filesize',glob('*')));
?>
Unfortunately there's no way to do this recursively, using glob() (as far as I know).
----
Server IP: 194.153.94.10
Probable Submitter: 80.243.211.68
----
Manual Page -- http://www.php.net/manual/en/function.glob.php
Edit -- https://master.php.net/note/edit/83287
Del: integrated -- https://master.php.net/note/delete/83287/integrated
Del: useless -- https://master.php.net/note/delete/83287/useless
Del: bad code -- https://master.php.net/note/delete/83287/bad+code
Del: spam -- https://master.php.net/note/delete/83287/spam
Del: non-english -- https://master.php.net/note/delete/83287/non-english
Del: in docs -- https://master.php.net/note/delete/83287/in+docs
Del: other reasons-- https://master.php.net/note/delete/83287
Reject -- https://master.php.net/note/reject/83287
Search -- https://master.php.net/manage/user-notes.php