Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
Serzol64 opened this issue Jul 6, 2022 · 1 comment

Comments

@Serzol64
Copy link

Serzol64 commented Jul 6, 2022

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!

@diegoBSousa
Copy link

diegoBSousa commented Sep 12, 2022

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants