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
Post a Comment