Skip to content Skip to sidebar Skip to footer

Php Simple Html Dom - How To Get The Text Inside A Tag

I use PHP Simple HTML Dom to get some HTML, now I have a HTML dom like follow code, I need fetch the plain text inner a tag, but I am getting the text link(Kiwi Fruit Basket). HTM

Solution 1:

try: innertext() innertext used for Read or write the inner HTML text of element.

foreach($html->find('.name a') as$element) 
    {
        echo"<br>a tag text value=" . $element->innertext;
    }

API Ref

Post a Comment for "Php Simple Html Dom - How To Get The Text Inside A Tag"