PHP 结合 js 来实现咯....<body>
在这个位置输出<span id=kk></span>
</body>
<?
$a="haha";
echo "<script>document.all.kk.innerText=$a;</script>";
?>
在这个位置输出<span id=kk></span>
</body>
<?
$a="haha";
echo "<script>document.all.kk.innerText=$a;</script>";
?>
echo "<script>document.all.kk.innerText='$a';</script>";
{yyy}
</body>
文件名为4.htm
<?
$htmlS=implode('', file("web/".$row[grade]."/4.htm"));
$htmlS=str_replace('{yyy}',haha, $htmlS);?>作为模板,发向一输出即可,参考一下,直接输出代码省略~