I upgraded to PHP 5.3 and i got the error: ereg has been deprecated.
What can i use to replace this??
function CheckIfAlphaNumberic($text) {
if (ereg('[^A-Za-z0-9]', $text)) {
unset ($text);
}
return $text;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
preg_match():See also: Switching From ereg to preg
Furthermore, you may use
return null;instead ofunset ($text);