remove html tags from a string except p in php

Solutions on MaxInterview for remove html tags from a string except p in php by the best coders in the world

showing results for - "remove html tags from a string except p in php"
Louis
16 May 2017
1$text = '<div class="test"><p>Clean <a href="#">text</a><br><b>Bold</b> text</p></div>';
2
3$cleanText = strip_tags($text, ['p','b','i','br']);