龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

php输出缓冲实现

时间:2014-06-20 03:15来源:网络整理 作者:网络 点击:
分享到:
php输出缓冲实现 ```phplt;?php // Start buffering ob_start(); // Output stuff (probably not this simple, might be custom CMS functions... echo #39;Print to the screen!!!#39;; /
<?php
      // Start buffering
      ob_start();

      // Output stuff (probably not this simple, might be custom CMS functions...
      echo 'Print to the screen!!!';

      // Get value of buffering so far
      $getContent = ob_get_contents();

      // Stop buffering
      ob_end_clean();

      // Do stuff to $getContent as needed

      // Use it
      echo 'Now: ' . $getContent;

    ?>
精彩图集

赞助商链接