paquettg/php-html-parser

Too few arguments to function PHPHtmlParser\Dom::loadStr(), 1 passed and exactly 2 expected

Serzol64 opened this issue · 1 comments

All the good time of day

I like your library.0 but the point of the question is that following the instructions in your README.mdie isn ' t exactly library .

  • The example of the loadStrда call code itself: $contentQuery = (new Dom)->loadStr($curA->content);
  • But invoking an A.D. compiler gave the following links to a fragment from your library: Screenshot

$curA->content - is the operating parameter of the HTML code .

How to run the right method without any parameters after the content , as in the basic parts of the documentation , the same settings that are missing for the library 's complete work?

Thank you very much!

Try on adding a second parameter:

     $options = [];
     $contentQuery = (new Dom)->loadStr($curA->content, $options);

Because loadStr has this signature: public function loadStr(string $str, ?Options $options = null): Dom
https://github.com/paquettg/php-html-parser#options