清除页面的方法:使用“header("last-modified:".gmdate("d,d m y h:i:s" )."gmt");header("cache-control:no-cache,must-revalidate");”即可。
推荐:《php视频教程》
在开发过程中我们常常会遇到页面缓存的问题(特别是html的缓存);刷新后还是旧版的数,再刷新下还是旧版数据,慢慢的开始怀疑人生了,哈哈;所以在开发过程中我们又必要每次及时清除缓存。
加入几行代码就可搞定这个问题,控制浏览器缓存
header("expires: mon, 26 jul 1997 05:00:00 gmt");header("last-modified: " . gmdate("d, d m y h:i:s") . "gmt");header("cache-control: no-cache, must-revalidate");header("pragma: no-cache");方法2:
header("cache-control: no-cache, must-revalidate");header("expires: mon, 26 jul 1997 05:00:00 gmt");header("content-type: application/xml; charset=utf-8");