php 前端自动更新css和js,防止页面缓存
<?php
function autoVer($url){
$ver = filemtime($_SERVER['DOCUMENT_ROOT'].$url);
echo $url.'?v='.$ver;
}?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>
<block name="title"></block>
</title>
<link href="<?php autoVer('__DATA_CENTER_CSS__/info.css') ?>" rel="stylesheet" type="text/css"/>
<link href="<?php autoVer('__DATA_CENTER_CSS__/admin.css') ?>" rel="stylesheet" type="text/css"/>
</head>