PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I think you can use Output buffering ob_* functions to do this
ob_start(),ob_end_clean(),ob_flush(), ob_end_flush() , ob_end_clean().
-just control the output and where you find specified word replace them!
<?php
function callback($buffer) {
// replace all the apples with oranges
return (ereg_replace("apples", "oranges", $buffer));
}
ob_start("callback");
?>
<html>
<body>
<p>It's like comparing apples to oranges with bananas and some grapes.
</body>
</html>
<?php
ob_end_flush();
?>
How do i do more of them like exampe changing the work 'bananas' to 'yellow bananas' and the word 'grapes' to 'purple grapes'.