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

JQuery Autocomplete without using label, value, id -

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

JAVA - what is the difference between void and boolean methods? -