Re: Wildcard search
| From: | Marco Tabini | Date: | Fri, 08 Nov 2002 14:34:34 +0000 |
| Subject: | Re: Wildcard search | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123383@lists.php.net to get a copy of this message | ||
How about:
$a = explode (' ', shell_exec ("ls $foldername/*.html"));
This should return an array that contains the name of all the *.html
files in the folder $foldername, if any.
Hope this helps.
Cheers,
Marco
-------------
php|architect -- The Monthly Magazine For PHP Professionals
Come visit us on the web at http://www.phparch.com!
On Fri, 2002-11-08 at 09:34, Mako Shark wrote:
>
> I've tried doing a search for this problem on the web, but haven't found anything,
> nor have I found any solution on the php.net documentation.
>
>
>
> Does anyone know if it's possible to do a file search with a wildcard character? I need to
> find if there are any HTML files in a certain directory, but file_exists("htmls/*.html")
> doesn't seem to work when tested. Neither do similar applications of readdir(). Is there
> another way to do this, or do I have to do a readdir() and read the filename of every file until I
> find an HTML or until all files have been read.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive medley & videos from Greatest Hits CD