smarty turns on caching garbled characters
风起时丶丶想你
风起时丶丶想你 2018-10-10 17:17:10
0
2
873

After smarty turns on the cache, the page will be garbled for the first time, and then it will be normal. The project and the page are all utf8 encoded, so I don’t know about the *** issue.

The PHP code is as follows (smarty3.1.16)

<?php

include_once './libs/Smarty.class.php';

$ smarty = new Smarty();

$smarty->caching =1;

$smarty->cache_lifetime =3 ;

$smarty->assign( "name","Everything goes well");

$smarty->display("name.html");


##template

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

</head>

<body>

{$name}

</body>

</html>


风起时丶丶想你
风起时丶丶想你

reply all(2)
风起时丶丶想你

After changing the php version, I found that it was caused by php6 itself. I don’t know what caused it specifically. Anyway, try to use php5 or 7 instead of 6.

风起时丶丶想你

Can anyone explain it?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!