strip_tags: strip off the messy tags and styles
问题 How can I strip off certain html tags and allow some of them? For instance, I want to strip off span tags but allow the span with underline. <span style="text-decoration: underline;">Text</span> I want to allow p but I want to remove any styles or classes inside the p for instance, <p class="99light">Text</p> the class inside the p tag should be removed - I just want a clean p tag. The is the line I have so far, strip_tags($content, '<p><a><br><em><strong><ul><li>'); 回答1: You can't. You'll