当前位置:Gxlcms > PHP教程 > php输出缓冲的小例子

php输出缓冲的小例子

时间:2021-07-01 10:21:17 帮助过:2人阅读

  1. //开启缓冲

  2. ob_start();

  3. // Output stuff (probably not this simple, might be custom CMS functions...

  4. echo 'Print to the screen!!!';

  5. // Get value of buffering so far

  6. $getContent = ob_get_contents();

  7. // Stop buffering

  8. ob_end_clean();

  9. // Do stuff to $getContent as needed

  10. // Use it

  11. echo 'Now: ' . $getContent;
  12. ?>

人气教程排行