#10154 [Com]: Function ereg array results
| From: | virtual-page697 at hotmail dot com | Date: | Tue, 20 Jul 2004 14:59:50 +0000 |
| Subject: | #10154 [Com]: Function ereg array results | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-62758@lists.php.net to get a copy of this message | ||
ID: 10154
Comment by: virtual-page697 at hotmail dot com
Reported By: crash at musichall dot cz
Status: Bogus
Bug Type: *Regular Expressions
Operating System: Linux/NT
PHP Version: 4.0.4pl1
New Comment:
<a href=http://virtual-armed-heels.da.ru>virtual
page</a>
Previous Comments:
------------------------------------------------------------------------
[2001-08-31 06:26:14] sander@php.net
From the manual:
"If ereg() finds any matches at all, $regs will be filled with exactly
ten elements, even though more or fewer than ten parenthesized
substrings may actually have matched."
------------------------------------------------------------------------
[2001-04-04 06:44:26] crash at musichall dot cz
I'm not sure, if it's really an error or "feature" :). I would like to
get $regs[10] value, but the output is always empty.
<script language="php">
$string = "1234567890";
ereg( "^(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)", $string, $regs);
echo "Whole string: " . $regs[ 0 ] . "<br>";
for ( $i = 1; $i <= 10; $i++ )
{
echo "<br>" . $i . " -> " . $regs[$i];
}
</script>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=10154&edit=1