You are here: Re: beginner question: directory handling & sorting « PHP Programming Language « IT news, forums, messages
Re: beginner question: directory handling & sorting

Posted by Chung Leong on 08/16/06 00:24

Eric Capps wrote:
> I am trying to open a directory on a file server to populate a drop down
> menu. I've been able to do this, but the results are not sorted
> alphabetically. How would I go about this? I've looked at the php.net
> site on directory functions, but haven't found a solution that works.
> The sort() function seemed like it should, but it instead returned an
> error: sort() expects parameter 1 to be array, resource given.
>
> Any help would be appreciated.

glob() returns a list of file paths already sorted. See
http://fi.php.net/glob/. The elements will include the directory if one
is specified in the pattern. Use basename() to strip it out.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация