note 28744 modified in ref.xml by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Mar 2010 18:46:43 +0000 |
| Subject: | note 28744 modified in ref.xml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166604@lists.php.net to get a copy of this message | ||
use:
<?php
while ($data = str_replace("\n","",fread($fp, 4096))){
// ...
}
?>
instead of:
<?php
while ($data = fread($fp, 4096)) {
// ...
}
?>
It will save you a headache.
--was--
use:
while ($data = str_replace("\n","",fread($fp, 4096))){
instead of:
while ($data = fread($fp, 4096)) {
It will save you a headache.
and in response to (simen at bleed dot no 11-Jan-2003 04:27) "If the 4096 byte buffer fills
up..."
Please take better care of your data don't just shove it in to the xml_parse() check and make
sure that the tags are not sliced the middle, use a temporary variable between fread and xml_parse.
http://php.net/manual/en/ref.xml.php