replace multiple br tag to one br tag in php

by Francis 2014-09-26 15:24:21

Use Preg Replace : continuous multiple br tag to one br tag
<?php
$html = preg_replace('#(<br */?>s*)+#i', '&lt;br /&gt;', $html);
?>
 
1252
like
0
dislike
0
mail
flag

You must LOGIN to add comments