OK So what's the main difference between the two?
function validateIP($ip)
{
$valid = false;
$regexp = '/^((1?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(1?\d{1,2}|2[0-4]\d|25[0-5])$/';
if (preg_match($regexp, $ip))
{
$valid = true;
}
return $valid;
}
When I replace preg_match with ereg it no longer works, so what is the difference, when they both do a regular expression match?