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.
[Back to original message]
|