Re: Show Filename using Wildcards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rahul Sitaram Johari wrote:
Ave,

Yes well, I did kind of figure out that I have to scan through contents of a
directory, pull up a file list, and then do some kind of pattern matching to
narrow down to the files I need. But at this moment I'm kinda struggling
with the directory & file functions - haven't really dwelled into those
deeply before.
Good place to start:
http://www.php.net/manual/en/function.opendir.php
Some good examples on getting contents of a directory...
-B

But yes, your suggestions seem more then likely what I'll be hitting at some
stage.
Thanks.


On 3/29/07 3:22 PM, "Brad Bonkoski" <bbonkoski@xxxxxxxxxxxxxx> wrote:


I'm sure there are many options...
I'm also assuming you are pulling from a file system and not a database...
So, loop through the directory and do something like this:
$phone_num = XXX
$cur_file = xxx
if( strncmp($phone_num, $cur_file, strlen($phone_num)) == 0 )
    //Matches
else
    //No Match

Ref: http://us3.php.net/manual/en/function.strncmp.php
(for case insensitive:
http://us3.php.net/manual/en/function.strncasecmp.php)
-B




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux