Wordpress ob_start()和ob_get_clean()的使用
我通常这样编码:Wordpress ob_start()和ob_get_clean()的使用,wordpress,buffer,Wordpress,Buffer,我通常这样编码: $output .= 'custom code'; $output .= 'another line of custom code'; $output .= 'more code'; return $output; 现在我想使用ob\u start(),ob\u get\u contents()和ob\u get\u clean()。 在我的示例中使用它最有效的方法是什么?这将返回与您给出的示例相同的结果: ob_start(); echo 'custom
$output .= 'custom code';
$output .= 'another line of custom code';
$output .= 'more code';
return $output;
现在我想使用ob\u start()
,ob\u get\u contents()
和ob\u get\u clean()
。
在我的示例中使用它最有效的方法是什么?这将返回与您给出的示例相同的结果:
ob_start();
echo 'custom code';
echo 'another line of custom code';
echo 'more code';
return ob_get_clean();