Strip tags in PHP with an allowed list but remove all attributes
In PHP, what is the fastest and simplest way to strip all HTML tags from a string, except the ones in an allowed list but by removing all HTML attributes. The built-in function strip_tags would have done the job but…