php - Merge these two regular expressions into one -


i feel can learn lot seeing these 2 regular expressions one. selecting space in between > , < while not selecting > , < themselves, can replace "" rather "><". there way these merged without selecting space?

 $html = preg_replace('/(\n)|(\r)/',"",$html); $html = preg_replace('/>(\s+)</',"><",$html); 

$html = preg_replace('/[\n\r]+|(?<=>)\s+(?=<)/',"",$html); 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

c++ - Accessing inactive union member and undefined behavior? -

php - Get uncommon values from two or more arrays -