时间:2021-07-01 10:21:17 帮助过:6人阅读
$bodytext = str_replace("%body%", "black", "");var_dump($bodytext);echo str_replace("world","John","Hello world!");
$bodytext = str_replace("%body%", "black", "");var_dump($bodytext);string(19) ""
谢谢
<,>应该要用字符实体表示,输出的值为空,是浏览器把它当成一个html标签了:
$bodytext = str_replace("%body%", "black", "<body text='%body%'>");
var_dump($bodytext);
echo str_replace("world","John","Hello world!");
不知道您是不是指的这个?