how to get div class value using dom document
i need to echo this value 4,458 members
from the below code
< div class="mbs fcg">4,458 members< /div>
right now my orginal code is
$links = $dom->getElementsByTagName('div');
foreach ($links as $link){
echo $link->nodeValue;
echo $link->getAttribute('class');
}
how to target this particular class = mbc fcg
?
now with my present code i am getting all div values.
what changes i should do