smarty開(kāi)啟緩存后第一次刷頁(yè)面亂碼,再刷一次就正常了,工程和頁(yè)面都是utf8編碼,不知道***問(wèn)題。
PHP代碼如下(smarty3.1.16)
<?php
include_once './libs/Smarty.class.php';
$smarty = new Smarty();
$smarty->caching =1;
$smarty->cache_lifetime =3 ;
$smarty->assign("name","萬(wàn)事如意");
$smarty->display("name.html");
模版
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
? {$name}
</body>
</html>
換了php版本發(fā)現(xiàn),原來(lái)是php6自己的原因,具體什么導(dǎo)致的不清楚,反正是盡量用php5或者7別用6