Created
November 21, 2016 11:53
-
-
Save dawehner/7cf96dc2e9b7f0d2bbb2f81b04bfc2c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static function removeHtmlTags($string, array $tags = []) { | |
| $dom = Html::load($string); | |
| foreach ($tags as $tag) { | |
| foreach ($dom->getElementsByTagName($tag) as $places) { | |
| $places->parentNode->removeChild($places); | |
| } | |
| } | |
| return $dom->saveHTML(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment