How can I only get the alt attribute of the a p tag in PHP?
I'm working on a script that echo's only the price. If I do: $alttag = $oNode['p']; echo $alttag; It will echo everything in <p></p> . So it will echo: roodmerk of cafeïnevrij pak 500 gram 2 pakken prijs per kilo 1,99 199 from the website, so you can see it echo´s 199, that´s the price but first I ONLY need 199 in the <p></p> and I want . or , between 199 so it will show 1,99 or 1.99. If I do: $alttag = $oNode['p sup']; echo $alttag; It will only echo 99 out of <sup></sup> If I do: $alttag = $oNode['p sup']; $maintag = $oNode['p']->attr('alt'); echo $maintag . $alttag; Well... This does