FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » sorting readdir output?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: sorting readdir output? [message #183999 is a reply to message #183998] Sun, 01 December 2013 17:13 Go to previous messageGo to previous message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma:
Senior Member
On Sun, 01 Dec 2013 11:56:04 -0500, Norman Peelman wrote:

> On 12/01/2013 11:39 AM, richard wrote:
>> <?php
>>
>> if ($handle = opendir('../audio/1960/')) {
>> echo "Directory handle: $handle\n";
>> echo "Entries:\n";
>>
>> /* This is the correct way to loop over the directory. */
>> while (false !== ($entry = readdir($handle))) {
>> echo "$entry\n<br>";
>> }
>>
>> closedir($handle);
>> }
>> ?>
>>
>> This gives the output in an unsorted list.
>> How can I make it so the array is sorted?
>>
>> http://us1.php.net/readdir
>>
>
> I would think it's be obvious that you need to *SORT* the $entry
> *ARRAY* before you output anything.

http://s2.quickmeme.com/img/e2/e2f5aa6bfb9d5754ab2678075f95572c502ae22456f1 25bf4c7ac4aaf055af85.jpg

http://www.quickmeme.com/img/ca/ca04c469a453cde96a177e91997888d9ff3a0157427 26d1234651dbd7c5ae780.jpg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: dropdown menus
Next Topic: Re: SEO SERVICES
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 07:12:04 GMT 2024

Total time taken to generate the page: 0.04002 seconds