php catch echo output

Solutions on MaxInterview for php catch echo output by the best coders in the world

showing results for - "php catch echo output"
Sophia
10 Aug 2016
1<?php
2ob_start(); // Start output buffering
3
4Render::UnorderedList(Class::getItems(), Class::getFields(), true); 
5
6$list = ob_get_contents(); // Store buffer in variable
7
8ob_end_clean(); // End buffering and clean up
9
10echo $list; // will contain the contents
11 ?>