Oziam Posted November 8, 2010 Share Posted November 8, 2010 It seems ereg is deprecated in php 5+ so what is a good alternative? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/218140-ereg-deprecated/ Share on other sites More sharing options...
snowman15 Posted November 8, 2010 Share Posted November 8, 2010 I believe preg_match() is the alternative but someone can correct me if i'm wrong. http://www.php.net/manual/en/function.preg-match.php Quote Link to comment https://forums.phpfreaks.com/topic/218140-ereg-deprecated/#findComment-1131949 Share on other sites More sharing options...
OldWest Posted November 8, 2010 Share Posted November 8, 2010 str_replace and preg_replace Quote Link to comment https://forums.phpfreaks.com/topic/218140-ereg-deprecated/#findComment-1131951 Share on other sites More sharing options...
AbraCadaver Posted November 8, 2010 Share Posted November 8, 2010 I believe preg_match() is the alternative but someone can correct me if i'm wrong. http://www.php.net/manual/en/function.preg-match.php Yes, if you need regular expressions. I've seen ereg()/eregi() used many times when strpos() would work just as well. Quote Link to comment https://forums.phpfreaks.com/topic/218140-ereg-deprecated/#findComment-1131954 Share on other sites More sharing options...
OldWest Posted November 8, 2010 Share Posted November 8, 2010 I was thinking you were wanting to find/replace.. oops! Quote Link to comment https://forums.phpfreaks.com/topic/218140-ereg-deprecated/#findComment-1131956 Share on other sites More sharing options...
Oziam Posted November 9, 2010 Author Share Posted November 9, 2010 Yes, if you need regular expressions. I've seen ereg()/eregi() used many times when strpos() would work just as well. Thanks, that does the trick nicely! Quote Link to comment https://forums.phpfreaks.com/topic/218140-ereg-deprecated/#findComment-1132036 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.