I just wrote a simple function to capture the output of any function. It is also a core of the general template system.
Copy code The code is as follows:
/**
* Capture the output of a function
* example:get_output(array($this,'test'));
*/
function get_output($array)
{
ob_start();
call_user_func($array);
return ob_get_clean();
}
?>
http://www.bkjia.com/PHPjc/317944.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/317944.htmlTechArticleA simple function just written to capture the output of any function. It is also a core of the general template system. Copy the code The code is as follows: ? /** *Capture the output of a function *...