Possible Duplicate:
Function ereg() is deprecated
I understand that in the new version of PHP ereg
is deprecated:
Deprecated: Function ereg() is deprecated
The code below worked fine in the old PHP. So I replaced ereg
with preg_match
and I am now getting the following error:
Warning: preg_match() [function.preg-match]: Unknown modifier '{' in
Here is my code...
if (!empty($searchval))
{
if(ereg("[0-9]{5}", $searchval)) {
$zip = $searchval;
}
else {
$city = $searchval;
}
} else
{
$error .= "<div id='Error'>Please enter zip</div>";
$zip = false;
}