我遇到了一个非常奇怪的问题。今天我尝试在我的 PHP 应用程序中实现缓存。
它在我的本地 WAMP 服务器(Windows 8)上就像一个魅力。但它在网上不起作用。
因此,我不知道我做错了什么。
代码有点像:
<?php
function write_cache(){
$contents = ob_get_contents();
/// do something with contenst (like writing it..
}
$tpl_content = 'loooooong string'; // gets filled throughout the application
echo $tpl_content;
/// should be filling the cache
write_cache();
?>
这应该有效。我回显它,因此它在缓冲区中。而且我在某个地方做得正确,因为它在本地工作。
但是网上还是空的。。
有谁知道我做错了什么?
提前致谢!!