View Single Post
Old 02-23-2009, 08:23 PM   #1 (permalink)
Lou_Gato
The Wanderer
 
Join Date: Oct 2008
Posts: 14
Thanks: 0
Lou_Gato is on a distinguished road
Default 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)) {
	if ($dh = opendir($dir)) {
 while (($file = readdir($dh)) !== false) {
	if($file != '.' & $file != '..' & $file != '' & filetype($dir)=='dir'){
$pieces = explode(".", $file);
$extension = $pieces[1];
if(array_search($pieces[0], $existing)){
if($found == 0) { $found = 0;
}
}else{
if($extension == 'wmv'){							
//echo "$file " . filetype($dir . $file) . "<br>";
echo "<input type='radio' name='trailer' value='".$pieces[0]."'>
<font color='white'> ".$file."</font><br>";
								
								}
				}
		}
 	}// end while
  closedir($dh);
 }
}
thanks everyone.. your help is truly appreciated.
Lou_Gato is offline  
Reply With Quote