Hey Guyz! I am going to show how you can strip some HTML tags from given string by avoiding some particular tags to strip.
And this is PHP function
strip_tags( "<YOUR_STRING_WILL_GO_HERE>", $allowable_tags )
$allowable_tags is the tags you do not want to strip. You can keep it blank to strip all tags.
Let’s see how it works.
- Check the below screenshot; its showing a code and output of string without using strip tag.
- Now let’s use strip_tags function and see the result; its plain text without any effect
- Now let’s say that we do not want to strip some tag say <b> and <u> and see the result
Hope this helps you to understand PHP strip_tags function!
Thank You! We will update you with more interesting things soon. 🙂