They about listed it, but why use a text file? Why not a pre-tagged .html file, and simply include() or require() it?
[right][snapback]475334[/snapback][/right]
He may have something like a forum that saves plain text to a file with something like BBCODES, and has to change them on the fly.
Instead of doing $text = str_replace("{INPUT}", "{OUTPUT}", $text); 5 million billion times, why not do this?
CODE
$whatever_input = array("input", "input", …, "input");
$whatever_output = array("output", "output", …, "output");
$text = str_replace($whatever_input, $whatever_output, $text);
5 million billion array entries instead of 5 million billion lines.
hopefully I didn't massacre that >< I am still newb at PHP. But I have used str_replace with arrays before, and php.net has an example with them.
[right][snapback]475175[/snapback][/right]
As for this, it should work, but personally, I'd do it different then both of these. I was just saying that if he only needed a few changed he could do that.
For me, I'd store all the changes that take place in a MySQL database, then grab them all and cycle through them, changing them in a loop.
All of these ways should work, it's up to you to decide which on to use though.