I have an HTML string and I'd like to make some text formatting on its pure text content. I mean, I'd like to extract anything that is a text and not included into the tag braces. But... I've planned to use a DOMDocument, but I don't know the tags I'm looking for, nor their ID.
For example, I can Have that string
<p><i>some tex<span class="aclass">t</span> in the document.</i>Whoooa <img src="anImage.png" /></p>
And I'd like to format the "some text in the document.Whoooa " string before reinjecting the whole text formatted with the original tags in the page. For example to put a space after the point and deleting the ending space.
How would I do that ?