ted_chou12 Posted December 14, 2006 Share Posted December 14, 2006 I cant seem to find the difference between the two, which one should i choose for replacing submit form messages?(I am using the replace function to replace smiliey codes with <img> pictures) Link to comment https://forums.phpfreaks.com/topic/30633-difference-between-ereg_replace-and-str_replace/ Share on other sites More sharing options...
boby Posted December 14, 2006 Share Posted December 14, 2006 [url=http://www.php.net/manual/en/function.ereg-replace.php]ereg_replace[/url] = [i]Replace regular expression[/i][url=http://www.php.net/manual/en/function.str-replace.php]str_replace[/url] = [i]Replace all occurrences of the search string with the replacement string[/i]If you know the exact submit messages (strings), I suggest to use [i]str_replace[/i], but if you need regular expression to determine messages, go for [url=http://www.php.net/manual/en/function.preg-replace.php]preg_replace[/url] instead of [i]ereg_replace[/i].Boby Link to comment https://forums.phpfreaks.com/topic/30633-difference-between-ereg_replace-and-str_replace/#findComment-141103 Share on other sites More sharing options...
ted_chou12 Posted December 14, 2006 Author Share Posted December 14, 2006 thankyou!!! :D Link to comment https://forums.phpfreaks.com/topic/30633-difference-between-ereg_replace-and-str_replace/#findComment-141159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.