<?php
ob_start(); //开启缓存
echo 'Hello World';
$content = ob_get_contents(); //把内部缓存赋值给$content
ob_end_clean();//清除缓存并关闭
echo $content; //是不是有看到效果了?
<?php
ob_start(); //开启缓存
echo 'Hello World';
$content = ob_get_contents(); //把内部缓存赋值给$content
ob_end_clean();//清除缓存并关闭
echo $content; //是不是有看到效果了?