se non ho capito male si deve fare una funzione e poi richiamarla con ob_start per poi chiudere tutto con ob_end_flush?
tipo su php.net
Codice PHP:
<?php

function callback($buffer
{
  
// replace all the apples with oranges
  
return (str_replace("apples""oranges"$buffer));
}

ob_start("callback");

?>

<html>
<body>


It's like comparing apples to oranges.
</body>
</html>

<?php

ob_end_flush
();

?>
oppure non è necessario creare la funzione?