You are here: Re: i will kill my(sql) self ! :-) « PHP Programming Language « IT news, forums, messages
Re: i will kill my(sql) self ! :-)

Posted by Dave M on 11/14/05 19:01

In article <dla9ra$19oe$1@fegnews.vip.hr>, g0c says...
>
>hi all,
>i really cannot find a simple exmaple for preg_match function
>
>i whiled the files in the directory ...
>
>$d = dir('.') or die($php_errormsg);
>while (false !== ($f = $d->read())) {
> if (is_file($d->path.'/'.$f)) {
> if (preg_match(match????,substr($f,3))) {
> // print '<option> ' . $f . '<option>';
> echo "$f\n";
> }
> }
>}
>$d->close();
>
>i want to include files begining with "tn_"
>what in the heck must stand in pattern position, i tried everything ,
>nothing worked
>i have actually 8 files starting with tn_* of course ...
>
>thanks
>
>

I think you use a regular express in place of "match????,". Such as..

$match = '/pattern to match/'
if (preg_match($match, substr($f,3))) {

}


Dave
--
Basic Newsguy - 3 GB / month - $39.95 / year
http://newsguy.com/overview.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация