PHP 4.0 Bug #5183: ereg function not assigning value to 3rd argument
| From: | yubby at lanset dot com | Date: | Thu, 22 Jun 2000 00:24:22 +0000 |
| Subject: | PHP 4.0 Bug #5183: ereg function not assigning value to 3rd argument | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22077@lists.php.net to get a copy of this message | ||
From: yubby@lanset.com
Operating system: RedHat Linux 6.2
PHP version: 4.0.0 Release
PHP Bug Type: Scripting Engine problem
Bug description: ereg function not assigning value to 3rd argument
The "ereg" function is not assigning values to the 3rd argument passed to it, when used in
a function (when in the 'main' script, it seems to work fine).
The example I'm using is ($address displays it's value, the values of the $parsed array
never display):
<?php
// Email address entry validation
function check_email ($address) {
// Returns and array of 'parsed' Email address if a valid email, 0 if not
if ($address) {
if (ereg("^.+@.+\\..+$", $address, $parsed)) {
echo "$address <BR>\n";
echo ("Username: $parsed[1] <BR>\n");
echo ("Top-Level Domain: $parsed[3] <BR>\n");
echo ("Domain: $parsed[2] <BR>\n");
return $parsed;
}
}
return 0;
}
?>