PHP str_replace() 函数

把字符串 “Hello world!” 中的字符 “world” 替换为 “Shanghai”:

echo str_replace(“world”,”Shanghai”,”Hello world!”);