Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Since <strong>Simple HTML DOM</strong> does already have a method for selecting attributes that contain a certain value and|or something else. For example</p> <blockquote> <p><code>$html-&gt;find("div[class*=col]", 0)-&gt;outertext</code></p> </blockquote> <p>Or you could just retrieve <code>div</code> nodes that start with <code>col</code> like so</p> <blockquote> <p><code>$html-&gt;find("div[class^=col]", 0)-&gt;outertext</code></p> </blockquote> <p>And for safe keeping you can find all the other ways to filter attributes in this 3rd party plugin (By the way there are way better things for dealing with DOM that are based on <code>libxml</code>, a definitive list can be <a href="https://stackoverflow.com/questions/3577641/how-to-parse-and-process-html-with-php/3577662#3577662">found here</a>)</p> <ol> <li><code>[attribute]</code> - Matches elements that have the specified attribute.</li> <li><code>[!attribute]</code> - Matches elements that don't have the specified attribute.</li> <li><code>[attribute=value]</code> - Matches elements that have the specified attribute with a certain value.</li> <li><code>[attribute!=value]</code> - Matches elements that don't have the specified attribute with a certain value.</li> <li><code>[attribute^=value]</code> - Matches elements that have the specified attribute and it starts with a certain value.</li> <li><code>[attribute$=value]</code> - Matches elements that have the specified attribute and it ends with a certain value.</li> <li><code>[attribute*=value]</code> - Matches elements that have the specified attribute and it contains a certain value.</li> </ol> <p>Source: <a href="http://simplehtmldom.sourceforge.net/manual.htm" rel="nofollow noreferrer">http://simplehtmldom.sourceforge.net/manual.htm</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload