Home >Backend Development >PHP Tutorial >PHP example code for batch replacement of html tags_PHP tutorial
1. Remove all html elements, or keep certain html tags
Test paragraph. Other text2 .On the contrary, only remove a certain html tagTest paragraph.
Other text
$str = 'red text';
$tags = 'font';
$a = strip_only($str, $tags); // red text
$b = strip_only($str, $tags, true); // text
?>