Archive for February, 2008
Substitute Using str_replace
12Feb08
Sometimes you simply want to replace part of string with something else, like changing your address when you move. You could use a fancy grep replace or similar functionality, but if it is a simple substitution it is usually easier to just go with the string function str_replace.
Here is how it works:
$newwork = str_replace($old, $new, [...]
Filed under: Functions | Leave a Comment
Search
-
You are currently browsing the PHP Basics weblog archives for the month February, 2008.