Re: Sorting Arrays
| From: | Jay Greenspan | Date: | Sat, 19 Aug 2000 03:08:56 +0000 |
| Subject: | Re: Sorting Arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-12558@lists.php.net to get a copy of this message | ||
>> $d = dir("/your/path");
>> while($artist_list=$d->read())
>> {
>> if(is_dir("path/$artist_list"))
>> {
>> $artist[] = $artist_list;
>> }
>> }
>> sort($artist);
>> foreach($artist as $value)
>> {
>> echo "$value<BR>\n";
>> }
>> $d->close();
>> ?>
>
>As a newbie to php I have seen -> used
>but what does it do?
The dir() function returns information in an object-oriented way.
You can read about OO at PHPbuilder:
http://www.phpbuilder.com/columns/luis20000420.php3
Take a look at the example in the manual's readdir function
to see how you'd do this without OO
syntax
http://www.php.net/manual/function.readdir.php
-j