PHP - ob_start - 替换文本以调用函数

时间:2015-11-12 22:44:40

标签: php html html5

我有:

PHP

<?php

function first_function() {
  return "A";
}

function second_function($first, $second) {
  return $first . $second;
}

ob_start(function ($buffer) {
  return $buffer;
});

?>

HTML 例如

<h1>@first_function</h1>

<h2>@second_function(A, B)</h2>

我的问题:如何在HTML中使用ob_start()调用输入的函数??

更新

我需要将文字@first_function替换为<?php echo first_function(); ?>&amp;&amp;带有<?php echo second_function("A", "B"); ?>

的@second_function(A,B)

0 个答案:

没有答案