I have this peace of code. This is PHP, not javascript.
$doc = new DOMDocument();
$doc->loadHTML($article_header);
$imgs = $doc->getElementsByTagName('img');
foreach ($imgs as $img) {
So in $imgs variable sits object with tag img. But some of my img tags have classes, and some no. What I want to do now is to check which $imgs has class. So how can I do that ?
this works fine and catches all
img‘s who have a class set: