I am hoping someone here can offer an explanation of what is happening and possibly offer a few suggestions in improving the efficiency of this method.

Echoing long strings takes a very long time, a string of about 25000 characters takes about 0.7 seconds to "process".

Now, I figured, ok, lets make the strings smaller. So, to test it out, I produced the following code:

PHP Code:
$output explode("\n"$output);
while (list (
$line_num$line) = each ($output)) {
echo 
$line"\n";

Basically, this code creates an array, breaks apart the elements wherever there is a line break. Now, what is strange, this actually is MUCH faster than echoing the single variable, something is really not right here. In terms of comparison, this on an average string of 25000 characters and 1000 line breaks, is about 4x faster than simply echoing the string at one time.

If anyone can offer any kind of explanation, or a more efficient method of echoing this string, it would be appreciated.

Regards,
Shawn