capture_buffer
Capture output buffer from PHP script.
Installation
capture_buffer lives on packagist.org
$ composer require donut/capture_buffer
Usage
<?php require "vendor/autoload.php";
$out = \Donut\Util\capture_buffer($filename);
API
capture_buffer( string $filename
)
Uses PHP ob_start and ob_get_clean to capture buffer of a required script.
Example
donut.php
<?php echo "donuts!";
example.php
<?php
$buffer = capture_buffer("donut.php");
var_dump($buffer);
Output
string(7) "donuts!"
Attribution
- duchess [email protected]
- Donut® Club http://github.com/donutclub
License
BSD 3-Clause