How to workaround PHP advanced html dom's conversion of entities? -
how can workaround advanced_html_dom.php str_get_html's conversion of html entities, short of applying htmlentities() on every element content?
despite
http://archive.is/ywkyp#selection-971.0-979.95
the goal of project dom-based drop-in replacement php's simple html dom library.
... if use file/str_get_html don't need change anything.
i find on
include 'simple_html_dom.php'; $set = str_get_html('<html><title> </title></html>'); echo ($set->find('title',0)->innertext)."\n"; // expected: observed: changing advanced html dom gives incompatible result:
include 'advanced_html_dom.php'; $set = str_get_html('<html><title> </title></html>'); echo ($set->find('title',0)->innertext)."\n"; // expected: observed: -á this issue not confined spaces.
$set = str_get_html('<html><body>•</body></html>'); echo $set->find('body',0)->innertext; // expected $bull; observed ÔÇó
you can check own package phphtmlquery, helps use php select html element using of css3 selectors.
the package works external links , internal html files too.
installation
open terminal , browse project root folder , run
composer require "abdelilahlbardi/phphtmlquery":"@dev" documentation
for more informations, please visit package link: phphtmlquery
Comments
Post a Comment