Output Buffering: ob_start non funziona come dovrebbe
Salve a tutti, è tutto il pomeriggio che sto impazzendo cercando di capire perchè ob_start e ob_end_flush non funziona..
Dopo molte prove ho fatto il solito test per verificare il funzionamento del buffering:
Citazione:
<?php
function callback($buffer)
{
// replace all the apples with oranges
return (str_replace("apples", "oranges", $buffer));
}
ob_start("callback");
?>
<html>
<body>
<p>It's like comparing apples to oranges.</p>
</body>
</html>
<?php
ob_end_flush();
?>
E invece di dare in output
Citazione:
It's like comparing oranges to oranges.
Mi ritorna
Citazione:
It's like comparing apples to oranges.
Come posso risolvere? Dove sta il problema???