Using Apache, is there a way to replace text in web pages, dynamically, before they are returned to the client?

For example, replace all occurances of a company name with a link to that companies page?

I specifically need a solution that will modify any HTTP text, from CGI, PHP, or just stored HTML.

Any suggestions?

Thanks.