In message <[EMAIL PROTECTED]>, Patrick
Bierans <[EMAIL PROTECTED]> writes
>> I need to find some pictures on the local server, and display them.  The
>> pictures are in the format pix/1234_01.jpg, pix/1234_02.jpg, etc.  But
>> the number varies, and their could be missing pictures (i.e., _03.jpg,
>> and no _02.jpg).
>> 
>> Does anyone have any suggestions as to find out how many pictures there
>> are on the server, with the pattern 'pix/1234*'  - and how I can go
>> through the file names?  
>
>this?
>
><?php
>  $dh=opendir('pix/');
>  while ($f=readdir($dh))
>    if (preg_match("/^\d+_\d+.(jpg|jpeg|gif|png)$/i",$f)
>      echo "found image: $f\n";
>
>  closedir($dh);
>?>

[EMAIL PROTECTED] preg_match - I should have known (:->

Thanks for that.

Would you / anyone have any idea of whether this will slow down if there
are a lot of pictures - there could be up to 1000/1200 in each folder.

-- 
Pete Clark

http://www.hotcosta.com
http://www.spanishholidaybookings.com




------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hrbbp1j/M=362131.6882499.7825260.1510227/D=groups/S=1705005703:TM/Y=YAHOO/EXP=1122995980/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to