Re: ereg question/prob...

From: Date: Thu, 15 Jul 2004 17:38:29 +0000
Subject: Re: ereg question/prob...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-190608@lists.php.net to get a copy of this message
In article <008d01c46a91$e3d202d0$0301a8c0@Mesa.com>, Bruce wrote: > $file = "tttt.txt"; > > ereg("(\.)([a-z0-9]{3,5})$", $file, $regs); > echo " ww = ".$regs. "<br><br>"; > > > i'm trying to figure out how to get the portion of the regex that's the > "extension" of the file. my understanding of the docs, says that the > "extension" should be in the $reg array.... > > any ideas/comments on where my mistake is would be appreciated... Will it work with 123.123.txt ? If you have a look at the file functions in the manual, you'll find much better solutions like pathinfo(); -- Tim Van Wassenhove <http://home.mysth.be/~timvw>

« previous php.general (#190608) next »