So I have a function such as:
public static function UnorderedList($items, $field, $view = false){
if(count($items) > 0){
echo \'\'
Very Similar to previous answer but a little more concise for my purposes:
I also want to mention how useful this is for PHP unit testing so as not to clutter your test logs with the output of what you are testing unless the test fails. Here is another stackflow answer related to this because I found this answer first on my google search when I was looking at how to test items with echo output : How to use output buffering inside PHPUnit test?