seopti
asked on
Function eregi() is deprecated
I believe preg_match should be used. What will be the code? Thank you.
1) if(ereg("^[A-Za-z0-9_]{1,255}$",$this->username))
2) if(eregi("^[https?://.+\..+]{1,255}",$this->url))
3) if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$",$this->email))
4) if(ereg("^[0-9]{1,6}$",$this->hits))
5) if(eregi("^[https?://.+\..+]{1,255}",$this->url)
&& eregi("[.+\@.+\..+]{1,255}",$this->email)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
Updated for preg-type expressions:Open in new window