If you want to further process the buffer' s contents you have to call ob_get_contents( ) before ob_end_flush( ) as the buffer contents are discarded after ob_get_contents( ) is called .
See also ob_start( ) , ob_get_contents( ) , and ob_end_clean( ) .