Bug #12340 Updated: ereg's documentation is wrong

From: Date: Tue, 24 Jul 2001 14:42:33 +0000
Subject: Bug #12340 Updated: ereg's documentation is wrong
References: 1  Groups: php.dev php.doc 
Request: Send a blank email to php-dev+get-60862@lists.php.net to get a copy of this message
ID: 12340 Updated by: andy Reported By: baumann@valudo.de Old Status: Open Status: Bogus Bug Type: Documentation problem Operating System: Linux PHP Version: 4.0.6 New Comment: Try looking at a script like this: <? ereg("(.*)\.(.*)","25.67",$regs); for ($i=0;$i<count($regs);$i++){ echo "$i -- $regs[$i]<br>"; } ?> regs[0] will have "25.67" regs[1] will have "25" regs[2] will have "67" The documentation is correct. Previous Comments: ------------------------------------------------------------------------ [2001-07-24 10:37:00] baumann@valudo.de Hi there, I'm sad to tell you, that I think to have found an error in your documentation or in PHP (that's up to you guys :) When I was trying to find a pattern in a string with ereg, I did not get any result in $regs[1] as you wrote. I found it in $regs[0] where the copy of the whole string supposed to be. So I think that's a mistake, isn't it?? But anyway, good work folks, c ya... Tom ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12340&edit=1

« previous php.dev (#60862) next »