php-simple-html-dom-parser
php-simple-html-dom-parser copied to clipboard
Maintained Fork of PHP Simple HTML DOM Parser (PHP 7.X)
https://github.com/voku/simple_html_dom
A HTML DOM parser written in PHP - let you manipulate HTML in a very easy way! This is a fork of PHP Simple HTML DOM Parser project but instead of string manipulation we use DOMDocument and modern php classes like "Symfony CssSelector".
- PHP 7.0+ Support
- PHP-FIG Standard
- Composer & PSR-4 support
- PHPUnit testing via Travis CI
- PHP-Quality testing via SensioLabsInsight
- UTF-8 Support (more support via "voku/portable-utf8")
- Invalid HTML Support (partly ...)
- Find tags on an HTML page with selectors just like jQuery
- Extract contents from HTML in a single line
However, I think there should be made some caveats about migration. In the fork:
- Method
find
wouldn't return[]
if nothing found. Consider replacing byfindOneOrFalse
orfindMultyOrFalse
in your code - Method
find
wouldn't return array, so you can't use methods likearray_pop
on it's result - There in no
attr
property, replace it bygetAttribute
in your code - Not all of the JQuery selectors are supported, i.e. there is no
:gt()
, I think others are missing too
This is the list, that we have faced during the migration