Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18585 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66736 invoked by uid 1010); 30 Aug 2005 22:10:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66720 invoked from network); 30 Aug 2005 22:10:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2005 22:10:26 -0000 X-Host-Fingerprint: 213.237.67.135 213.237.67.135.adsl.by.worldonline.dk Linux 2.4/2.6 Received: from ([213.237.67.135:29761] helo=mail.ter.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id CA/AE-15098-159D4134 for ; Tue, 30 Aug 2005 18:10:25 -0400 Received: from workpenguin (workpenguin [192.168.1.32]) by mail.ter.dk (Symaskine) with SMTP id F276F8A4011; Wed, 31 Aug 2005 00:10:03 +0200 (CEST) To: kevin@oceania.net (Kevin Waterson) Cc: internals@lists.php.net Date: Wed, 31 Aug 2005 00:09:27 +0200 Message-ID: References: <20050830235453.4e94a8bd.kevin@oceania.net> In-Reply-To: <20050830235453.4e94a8bd.kevin@oceania.net> X-Mailer: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: glob to take array as an arg From: php@ter.dk (Peter Brodersen) On Tue, 30 Aug 2005 23:54:53 +1000, in php.internals kevin@oceania.net (Kevin Waterson) wrote: >I would like to make this > >array glob ( array patterns [, int flags] ) > >This would tidy up much code where a series of OR's are used to match >different patterns. > >$arr =3D array('jpg', 'gif', 'tif', 'pdf', 'bmp', 'raw'); >foreach(glob($arr as $file)){ echo $file; } glob is currently extremely flexible in its input with the right flags and can expand a list. Eg: print_r(glob("*.{jpg,gif,tif,pdf,bmp,raw}",GLOB_BRACE)); If all you want is to supply glob() with a list of full or partial patterns I think the desired functionality is already present. --=20 - Peter Brodersen