You are here: Re: [PHP] duplicate filenames but different .extention « PHP « IT news, forums, messages
Re: [PHP] duplicate filenames but different .extention

Posted by Curt Zirzow on 12/19/05 02:03

On Sun, Dec 18, 2005 at 05:12:33PM -0600, matt VanDeWalle wrote:
> hello again
> I am trying to figure out how i can read the list of files in a directory
> using the opendir() and readdir() functions. Normally this goes fine but
> within the loop, what i am wanting to do is echo the filename if it is a
> jpg file, but if its a .gif, just continue.

One option, is to use glob():

foreach(glob('/path/tofiles/*.jpg') as $image ) {
echo $image;
}

Curt.
--
cat .signature: No such file or directory

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация