![]() |
need a little help guys... sort function.
I have this code i use to dispay wmv files in a certain directory, but now i want to sort the results in alphabetic order.. can anyone help me with this?
this is the code i have .. Code:
if (is_dir($dir)) { |
I would say use
glob, unless there is a particular reason you're using opendir. The glob function will automatically parse the directory in alphabetical order, and so I've reversed it in the example below to show you how it works to order.php Code:
|
sorry..
yeah i probably should have posted the whole script..
the reason i was using opendir is because i am doing a db query right before it to make sure it does not show the files that are already stored in the database.. Code:
<?php |
You could still use
glob in your current set-up. See the $aExisting variable in the following code, modified from my earlier version.Sorry to be so persistent, but I still believe the glob function is the best approach. Please correct me if you think I am wrong, and I will take a look at your own code to modify that accordingly :-) !php Code:
|
| All times are GMT. The time now is 01:29 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0