PHP DOMDocument | ends by null char (\u0) -
i noticed on url: http://www.bubbleroom.se/sv/kläder/kvinna/controlbody/bodys/body-nero there null character \u0
in tag id prodtext
.
the whole document seems end null char when attempting extract else after character.
edit
the code "doesn't" work. works, not when there's null char in $html
string
$dom = new domdocument; libxml_use_internal_errors(true); $dom->loadhtml($html); libxml_clear_errors(); return new domxpath($dom);
i solved issue filtering html before creating xpath instance following code:
$html = str_replace("\0", "", $html);
Comments
Post a Comment