php输出缓冲的小例子

原创
2016-07-25 08:56:03 721浏览
  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. ?>
复制代码


声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。