note 33364 added to ref.outcontrol
| From: | jharris at rallycentral dot us | Date: | Tue, 24 Jun 2003 04:40:59 +0000 |
| Subject: | note 33364 added to ref.outcontrol | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50909@lists.php.net to get a copy of this message | ||
To parse your output through HTMLtidy where PHP=>4.3.2, it is important to know about the fread()
bug (http://bugs.php.net/bug.php?id=24033). Previous versions had a bug which made the code
"work as expected." In addition to fixing this bug, there are some others in the HTMLtidy
parsing script posted here.
$gmt_modtime=gmdate('D, d M Y H:i:s', filemtime("/home/user/script.php") ).
' GMT';
$str=addslashes(ob_get_contents());
$fp=popen("echo \"" . $str . "\" | /usr/bin/tidy -config
/home/user/htmlrc", "r");
$newstr="";
do {
$data = fread($fp, 999999);
if (strlen($data) == 0) {
break;
}
$newstr .= $data;
}
pclose($fp);
ob_end_clean();
header("Last-Modified: " . $gmt_modtime);
header( "Content-length: " . strlen( stripslashes( $newstr ) ) );
echo stripslashes($newstr);
exit;
----
Manual Page -- http://www.php.net/manual/en/ref.outcontrol.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33364
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33364&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33364&report=yes