Re: ereg question/prob...

From: Date: Thu, 15 Jul 2004 20:07:50 +0000
Subject: Re: ereg question/prob...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-190618@lists.php.net to get a copy of this message
$regs is an array not a string ! try print_r or var_dump to determine $regexp's content Tim Van Wassenhove wrote:
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();


« previous php.general (#190618) next »