Forum Moderators: coopster
The process works with all of my scripts except for one that displays an rss feed. No matter what, the output makes it to the browser even w/ output buffering on. Here's my function...
function parseScript ($script) {
ob_start ();
include_once $_SERVER['DOCUMENT_ROOT'].$script;
$temp = ob_get_contents();
ob_end_clean();
return $temp;
}
Here is the output function of the script whose output I am trying to capture with the output buffer...
function CarpOutput($t) {
global $carpconf,$carpoutput;
if (is_array($t)) { for ($i=0,$j=count($t);$i<$j;$i++) $t[$i]=ereg_replace("'","'",$t[$i]); }
else $t=ereg_replace("'","'",$t);
switch ($carpconf['outputformat']) {
case 1:
if (!is_array($t)) $t=explode("\n",$t);
for ($i=0,$j=count($t);$i<$j;$i++) echo 'document.writeln("'.str_replace('"','\"',trim(str_replace("\r",' ',$t[$i])))."\");\n";
break;
case 2:
if (is_array($t)) for ($i=0,$j=count($t);$i<$j;$i++) $carpoutput.=$t[$i];
else $carpoutput.=$t;
break;
default:
if (is_array($t)) for ($i=0,$j=count($t);$i<$j;$i++) echo $t[$i];
else echo $t;
}
}
Any ideas would be greatly appreciated.
default:
if (is_array($t)) for ($i=0,$j=count($t);$i<$j;$i++) echo $t[$i];
else echo $t;
}
The bold part is what is echoing out the data and it is just html when I do a var_dump();
Are you certain that your output buffering is still on at this point? You can check the stack level [php.net] to be certain.