Reply to Re: newbie: scandir _not_ including directories

Your name:

Reply:


Posted by ljb on 12/30/07 02:35

dontspamme@spam.com wrote:
> I have a function below that I (partially) wrote to handle a
> particular situation.
>...
> I find that that scandir() also scans for subdirectories. I _only_
> want to scan for .txt files. Scandir is good for me to use because it
> alphabetizes the files without any additional work.
>
> I would appreciate any help that could be offered as far as ways to
> adjust my $files array so it's only made up of .txt files.

I think you have 2 choices: (1) scandir, then use is_dir() on each name to
discard sub-directories, or (2) if you really want 'names ending in .txt'
(which isn't the same as saying 'only text files'), use glob() and sort the
result yourself.

[Back to original 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

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