首頁  >  文章  >  後端開發  >  php輸出緩衝的小例子

php輸出緩衝的小例子

WBOY
WBOY原創
2016-07-25 08:56:031041瀏覽
  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