I know there is a lot of discussion for years on best methods of filtering data with PHP but I would like to go the whitelist approach in my current project.
I only
The simplest solution would be strip_tags(), which accepts a second argument containing allowable tags:
strip_tags(),
strip_tags($string, "");
");