How can I 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 this project is to be a DOM-based drop-in replacement for PHP's simple html dom library.
... If you use file/str_get_html then you don't need to 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 to advanced HTML DOM gives an 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 is not confined to spaces.
$set = str_get_html('<html><body>•</body></html>');
echo $set->find('body',0)->innertext; // Expected $bull; Observed ÔÇó
You can check my own package PHPHTMLQuery, it helps you to use PHP to select HTML element using most of CSS3 selectors.
Installation
Open your terminal and browse into your project root folder and run
Documentation
For more informations, please visit the package link: PHPHTMLQuery