- ob_start: documentation ( source)
- ob_end_flush: documentation ( source)
<?php
function callback($data) {
throw new Exception('test');
return $data . ' - called';
}
ob_start('callback');
echo "hi";
try {
ob_end_flush();
} catch (Exception $e) {
echo 'caught';
}