test.php
- <?php
- ob_start();
- include('mycache.php');
- $string = ob_get_contents();
- //ob_end_clean();
- $filename = "cache.txt";
- $fp = @fopen($filename,'w+');
- @fwrite($fp,$string);
- fclose($fp);
mycache.php
- <html>
- <head>
- </head>
- <body>
- test for some school things
- </body>
- </html>
用 ob_end_clean(); 不会输出 mycache。php里面的内容