prezident Posted January 11, 2011 Share Posted January 11, 2011 here my code <html> <head><title>TESTING</title></head> <body> <form method="GET" action="<?php echo $_SERVER['PHP_SELF']; ?>"/> email: <input type=text name=email value="" /><br/> feedback: <input type=text name=ex value=""/><br/> <input type="submit" value="submit" /><br/> </body> </html> <?php $email = $_GET['email']; $ex = $_GET['ex']; if(!eregi('^[a-zA-Z0-9\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z]+$',$email)){ echo 'invalid email address<br/>'; } else { echo 'good to go<br/>'; } if(eregi('money|brooklyn|new york' ,$ex)){ echo '1'; } else { echo '0'; } ?> The code works fine but when i put on my error reporting i get that eregi is deprecated, now if eregi is depreciated which function should i use ? or should i just suppress the error ? Quote Link to comment https://forums.phpfreaks.com/topic/224091-eregi-deprecated/ Share on other sites More sharing options...
BlueSkyIS Posted January 11, 2011 Share Posted January 11, 2011 DEPRECATED http://en.wikipedia.org/wiki/Deprecation eregi replacement: http://php.net/manual/en/function.preg-match.php Since the function is deprecated, it will be removed in a future version of PHP. If you suppress the error, your code is liable stop working for an unknown reason after eregi is removed. Quote Link to comment https://forums.phpfreaks.com/topic/224091-eregi-deprecated/#findComment-1157928 Share on other sites More sharing options...
Zurev Posted January 11, 2011 Share Posted January 11, 2011 Quote Since the function is deprecated, it will be removed in a future version of PHP. If you suppress the error, your code is liable stop working for an unknown reason after eregi is removed. Well the unknown reason is known, because it will have been removed! He just won't know it at the time! Quote Link to comment https://forums.phpfreaks.com/topic/224091-eregi-deprecated/#findComment-1157933 Share on other sites More sharing options...
prezident Posted January 11, 2011 Author Share Posted January 11, 2011 Quote Quote Since the function is deprecated, it will be removed in a future version of PHP. If you suppress the error, your code is liable stop working for an unknown reason after eregi is removed. Well the unknown reason is known, because it will have been removed! He just won't know it at the time! well i know now so.... when that time comes i guess i won't know cause i won't be using that function lol Quote Link to comment https://forums.phpfreaks.com/topic/224091-eregi-deprecated/#findComment-1157934 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.