DomQuery
DomQuery copied to clipboard
PHP library for easy 'jQuery like' DOM traversing and manipulation.
Hey there. I just added support for php 8.0. :)
```php use Rct567\DomQuery\DomQuery; $dom = new DomQuery('My words'); var_dump((string) $dom->find('p')->children()); // Dumps: 'My words' - CORRECT. $dom->find('p')->each(function($node) use ($dom) { var_dump((string) DomQuery::create($node)->children()); // Dumps: 'My words' - WRONG. // Workaround....
```php use Rct567\DomQuery\DomQuery; $dom = new DomQuery('My words'); $dom_clone = $dom->clone(); $is_has_the_class = $dom_clone->find('.myclass')->first()->is('.myclass')); // Expected: TRUE, but is FALSE $dom = new DomQuery('My words'); $dom_clone = (string) $dom; $is_has_the_class...
This is great now I have the latest Git clone - but spent hours trying to get things to work before eventually seeing I was using an old version after...
xpath() will not add dot for context node if no find() has been done, first so add function to check so cad do find(':root') first. @see #37
…s, else a find() must be done first.
See #35 Otherwise an error occurs with bad argument.
See #32 Uses unique update.