php - XMLReader and HTML code in node? -
i using xmlreader go through xml file. 1 of nodes contains html code, reader seems remove html code.
code:
$reader = new xmlreader(); $reader->open($file); while($reader->read()) { $nodename = $reader->name; if($nodename == 'description') { $test = $reader->readstring(); // html removed, why? } }
so, description node contains <b>this test</b>
, $test
var contains this test
... why?
thanks!
you should put html in cdata block!
Comments
Post a Comment