一、使用OB缓存
function getFileCont($filename) { ob_start(); include $filename; $content = ob_get_contents(); ob_end_clean(); return $content; }