i can't figure this out and it's pretty ugly.
a php file i include at the top of a bunch of files is processed the first time i call the function but for whatever reason, later outputted as raw text to the browser.......later down in the html. i just added a bunch of ereg_replace() lines, is this due to processing power or something?
following is the code i added, any advice would be appreciated.
ref: http://www.uac.pdx.edu/source.php?file=/avalanche.php
<TABLE border="0" width="100%">
<?
$file = fopen("http://www.seawfo.noaa.gov/products/archive/SABSEA.3", "r");
$rf = fread($file, 20000);
fclose($file);
$sections = split("*{8,}\n", $rf);
$sections[0] = eregi_replace ("\n([a-zA-Z0-9]{2})", "<BR>\n\1", $sections[0]);
$sections[1] = eregi_replace ("\n([a-zA-Z0-9]{2})", "<BR>\n\1", $sections[1]);
$sections[2] = eregi_replace ("\n\n([a-zA-Z0-9]{2})", "\n\n<P>\1", $sections[2]);
$sections[2] = eregi_replace ("[[:space:]]{5,}", "\n<BR><IMG src=\"/images/spacer.gif\" width=\"50\" height=\"1\">", $sections[2]);
$sections[3] = eregi_replace ("\n\n([a-zA-Z0-9]{2})", "\n<P>\1", $sections[3]);
if (eregi("SUMMER AVALANCHE STATEMENT", $rf)){
echo '<TR><TD align="right">Please note the Avalanche Forecast is a seasonal report.</TD></TR>';
}
foreach ($sections as $piece) {
echo "\n<TR><TD>\n";
echo $piece;
echo " \n</TD></TR>\n\n";
echo "\n<TR><TD>**********************************************************</TD></TR>\n";
}
?>
</TABLE>