标签: php ob-get-contents
是否可以使用ob_get_contents但保持php balise?
代码:
<?php ob_start(); ?> <?php echo 'asdfasdf'; ?> <?php $content = ob_get_contents(); ob_end_clean(); ?>
结果:
<?php echo 'asdfasdf'; ?>
答案 0 :(得分:0)
也许你只想要一个nowdoc:
echo <<<'STR' <?php echo 'asdfasdf'; ?> STR;