我想将google&堆栈替换为谷歌和堆栈。请指导我
答案 0 :(得分:2)
$str = str_replace('google&stack', 'google and stack', $str);
或
$str = str_replace('&', ' and ', $str);
答案 1 :(得分:1)
这应该有效
$string = "google & stack";
$string = str_replace(" & "," and ",$string);
$string = str_replace("&"," and ",$string);
返回google&堆
它在$string = google&stack"
$string = "google&stack";
str_replace("google&stack","google and stack",$string)
答案 2 :(得分:1)
这对我有用:
echo str_replace("&","and","facebook&google");