convert special characters but not tags
- by Tom
I've got some text which needs converting to use HTML entities, but it also contains tags. Here's a sample:
<p>Ofcom issued the warning to Global-owned GWR in Bristol – which is required to operate as a "contemporary and chart music and information station" – for operating outside the music </p>
The (" and -) need to be converted but the paragraph tags must remain HTML. Using something like htmlentities converts everything, how can I convert everything but the tags?