怎么没有替换过来啊 1.html的内容和temp.html一样
<?
ob_start();
include("temp/temp.html");
$contents=ob_get_contents();
$contents=str_replace("{$abc}","你好",$contents);
$contents=str_replace("{$boby}","哈密瓜",$contents);
$file=fopen("1.html","w");
fwrite($file,$contents);
fclose($file);ob_end_flush();
?>
<?
ob_start();
include("temp/temp.html");
$contents=ob_get_contents();
$contents=str_replace("{$abc}","你好",$contents);
$contents=str_replace("{$boby}","哈密瓜",$contents);
$file=fopen("1.html","w");
fwrite($file,$contents);
fclose($file);ob_end_flush();
?>
ob_start();
include("temp/temp.html");
$contents=ob_get_contents();
$contents=str_replace("{$abc}","你好",$contents);
$contents=str_replace("{$boby}","哈密瓜",$contents);
$file=fopen("1.html","w");
fwrite($file,$contents);
fclose($file);ob_end_clean();
echo $contents;
?>
$contents=str_replace("{\$boby}","哈密瓜",$contents);你替换的是字符串,不是变量。