Created
January 19, 2012 10:18
-
-
Save adhipg/1639267 to your computer and use it in GitHub Desktop.
remove empty html from a string
This file contains 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
<?php | |
function removeEmptyHTML($html_replace="") { | |
while(preg_match("/<[^\/>]*>\s*<\/[^>]*>/", $html_replace)) { | |
$html_replace = preg_replace("/<[^\/>]*>\s*<\/[^>]*>/","",$html_replace); | |
} | |
return $html_replace; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment