Re: Can I search for a partial match in an array ?

From: Date: Fri, 29 Mar 2002 01:07:17 +0000
Subject: Re: Can I search for a partial match in an array ?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-90628@lists.php.net to get a copy of this message
Thanks, worked great! "Bvr" <listmail@xs4all.nl> wrote in message news:3CA3BBA6.4020608@xs4all.nl... > > preg_grep("/^file/", $arr) > > bvr. > > Dalton Hunter wrote: > > >Hi, I want to search for a partial match in an array? Does in_array() or > >search_array() support this or is there another way? For example if I have > >30 file names in an array in the format ... > > > >file1.txt > >file2.txt > >pic1.gif > >pic2.gif > > > >... how can I check to see if any values in the array start with the > >partial word "file"? > > > > > > > > >

« previous php.general (#90628) next »