Tag Archives: php render_to_string

php render_to_string

Function: function render_to_string( $file, $context = array() ){ if( ! file_exists( $file ) ){ return “”; } ob_start(); include( $file ); $cnt = ob_get_clean(); return $cnt; } Example:http://www.softwarematrix.cn/example/php.render_to_string/ You can download the test code from the example.

Posted in PHP | Tagged , | 1 Comment