This one time, at band camp, PHP Gen <[EMAIL PROTECTED]> wrote:

> Hi,
> I have a function that reads jpg files (thumbnails)
> from a directory and puts all the files names into an
> array...I want to sort that array by the filename,
> problem is, I dont know if filenames will be pure
> numeric (eg 001.jpg,002.jpg) or alpha-numeric
> (asdf001,asdf002)


<?php 
  $hdl = opendir('./'); 
  while ($dirEntry = readdir($hdl)) { 
    if (substr($dirEntry, 0, 1) != '.') {
      $listing[] = $dirEntry; 
      }
    }
  natsort($listing);
  closedir($hdl);
  foreach($listing as $blah) { echo $blah.'<br />'; }
?>

or something.

Kevin

-- 
 ______                              
(_____ \                             
 _____) )  ____   ____   ____   ____ 
|  ____/  / _  ) / _  | / ___) / _  )
| |      ( (/ / ( ( | |( (___ ( (/ / 
|_|       \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to