Suppose I have a function, I'll call it output_data().
function output_data($data) {
print("<li>$data</li>\n");
}
I want to read the results of this function into an array, so that
$output = output_data("item1");
$output . = output_data("item2");
$output . = output_data("item3");
will set the value of $output to "<li>item1</li>\n<li>item2</li>\n<li>item3</li>\n".
So my question is, what do I use in the output_data function? Does print() work? I need something like return() that will not end the working of the function.