note 77479 added to function.scandir
| From: | deryckchan at gmail dot com | Date: | Fri, 31 Aug 2007 02:44:05 +0000 |
| Subject: | note 77479 added to function.scandir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129925@lists.php.net to get a copy of this message | ||
Bear in mind that sorting is *always* performed when scandir() is called. String sorting takes
O(|s|n log n) runtime, and this adds to the burden of the server's memory and processing power.
Therefore, whenever the alphabetical order of the directory content is unimportant, especially if
sorting is to be performed by another order, or the natural order of the files on the filesystem is
to be utilized, the use of opendir(), readdir() and closedir() combined is always preferred to
scandir().
----
Server IP: 203.169.164.81
Probable Submitter: 210.6.133.184
----
Manual Page -- http://www.php.net/manual/en/function.scandir.php
Edit -- https://master.php.net/note/edit/77479
Del: integrated -- https://master.php.net/note/delete/77479/integrated
Del: useless -- https://master.php.net/note/delete/77479/useless
Del: bad code -- https://master.php.net/note/delete/77479/bad+code
Del: spam -- https://master.php.net/note/delete/77479/spam
Del: non-english -- https://master.php.net/note/delete/77479/non-english
Del: in docs -- https://master.php.net/note/delete/77479/in+docs
Del: other reasons-- https://master.php.net/note/delete/77479
Reject -- https://master.php.net/note/reject/77479
Search -- https://master.php.net/manage/user-notes.php