PHP захват включает
ob_start();
include 'test.php';
$output = ob_get_clean();
Annoyed Aardvark
ob_start();
include 'test.php';
$output = ob_get_clean();