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! 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 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 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. 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! 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! Link to comment https://forums.phpfreaks.com/topic/218140-ereg-deprecated/#findComment-1132036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.