Re: Show Filename using Wildcards

From: Date: Fri, 30 Mar 2007 09:23:52 +0000
Subject: Re: Show Filename using Wildcards
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-251718@lists.php.net to get a copy of this message
On 29/03/07, Rahul Sitaram Johari <sleepwalker@rahulsjohari.com> wrote:
Ave, I have a script where I have to provide a Download Link to a file associated with a record. The common thing between the record & filename is the phone number. But the filenames have dates & other symbols besides the phone number as well. They all do begin with a phone number though. How can I match a filename with a record using wildcards? For example, let¹s say someone pulls up a record for phone field: 515515515 The files associated with this record could be 515515515031307 or 5155155150325T(2). So you can see the filenames do begin the phone number in the record, but they contain additional chars. What I need is something that can pull up all 515515515*.ext Can I do this in PHP?
yeah, you use glob() http://www.php.net/glob <?php foreach (glob("${phone}*.ext") as $filename) { //... } ?>

« previous php.general (#251718) next »