$bodytext = str_replace("%body%", "black", "<body text='%body%'>");var_dump($bodytext);echo str_replace("world","John","Hello world!");
$bodytext = str_replace("%body%", "black", "<body text='%body%'>");var_dump($bodytext);
谢谢
应该要用字符实体表示,输出的值为空,是浏览器把它当成一个html标签了:
$bodytext = str_replace("%body%", "black", "