Definition: You can use str_replace in PHP to find and replace data with alternate data. For example you could use it to filter forum posts to find offensive words and replace them with asterisks. It is phrased as: str_replace ( search_for, replace_with, apply_to )The first parameter is what you are searching for, the second parameter is what you will replace it with, and the third parameter is the string you want searched. All three parameters can use an array as input if desired.
(more…)