A small example of php output buffering

WBOY
Release: 2016-07-25 08:56:03
Original
1016 people have browsed it
  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. ?>

复制代码


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!