Let's say that I have this text my db.
<P>word1</P>
<P>word2</P>
<P>word3</P>
<P>word4</P>
How I can detect the number of <p> elements after I get my text from my db?
Thanks
Use the Simple HTML DOM parser for PHP to parse the contents of the text, select all 'p' elements, then count the size of the resulting array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With