note 33634 deleted from ref.xml by danbrown

From: Date: Wed, 03 Mar 2010 18:42:45 +0000
Subject: note 33634 deleted from ref.xml by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-166599@lists.php.net to get a copy of this message
Note Submitter: ml at csite dot com ---- A fix for the fread breaking thing: while ($data = fread($fp, 4096)) { $data = $cache . $data; if (!feof($fp)) { if (preg_match_all("(</?[a-z0-9A-Z]+>)", $data, $regs)) { $lastTagname = $regs[0][count($regs[0])-1]; $split = false; for ($i=strlen($data)-strlen($lastTagname); $i>=strlen($lastTagname); $i--) { if ($lastTagname == substr($data, $i, strlen($lastTagname))) { $cache = substr($data, $i, strlen($data)); $data = substr($data, 0, $i); $split = true; break; } } } if (!$split) { $cache = $data; } } if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } }

« previous php.notes (#166599) next »