果物というIDを持つスパンタグの中にあるので、出力「りんご」を取得したいと思います。では、そのコールバック関数にはどのようなコードを記述すればよいのでしょうか?
<?php
function callback($buffer) {
// get the fruit inHTML text, the output should be "Apples" only
....
....
}
ob_start("callback");
?>
<html>
<body>
<p>It's like comparing <span id="fruit">Apples</span> to Oranges.</p>
</body>
</html>
<?php
ob_end_flush();
?>