We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I filter which element is being processed?
for example, I have mutiple classes: $sels = "h2, .pnlDescription, .address";
I want to have a condition with the ".address" since I want to alter the text within it.
if(".address" == "somestring") { ----code--- }
Where and how can I achieve this one?
The text was updated successfully, but these errors were encountered:
I would go the other way:
$h2 = $doc->find('h2'); $desc = $doc->find('.pnlDescription'); $address = $doc->find('.address'); // ... do something with these
There are still some other options, but I think they are less performant:
$sels = $doc->find('h2, .pnlDescription, .address'); foreach($sels as $e) switch(true) { case $el->hasClass('address'): { // ... } break; case $el->nodeName == 'h2': { // ... } break; }
I would like to have ->is($selector) method, but have never had the need for it.
->is($selector)
Sorry, something went wrong.
Thanks for feedback that's all I need.
No branches or pull requests
How do I filter which element is being processed?
for example, I have mutiple classes:
$sels = "h2, .pnlDescription, .address";
I want to have a condition with the ".address" since I want to alter the text within it.
Where and how can I achieve this one?
The text was updated successfully, but these errors were encountered: