Created
May 14, 2012 10:36
-
-
Save mrcgrtz/2693196 to your computer and use it in GitHub Desktop.
Remove whitespace between DIV tags
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
/* Remove whitespace between DIV tags: | |
* <div class="foo"> | |
* <div class="bar"> | |
*/ | |
$str2 = preg_replace('/(<\/{0,1}div[^>]*>)(\s+)(<\/{0,1}div[^>]*>)/im', '\\1\\3', $str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment