Jump to content

difference between ereg_replace() and str_replace()


ted_chou12

Recommended Posts

[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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.