Fastest Web Hosting

how replace multiple br with only single br

0 votes
asked Sep 19, 2016 in Jquery by naseebsingh (2,160 points)

hello sir i using a jquery method to one <br> than multiple <br>

That's my code here

jQuery('body').html().replace(/(\<br\>\r\n){3, }/g,"\n");

but this is not work,something is wrong in this ,

1 Answer

0 votes
answered Sep 19, 2016 by Annus Memon (140 points)

$string = preg_replace("#(<br\s/?>(\r|\n|\s|\t))+#","<br />",$string);

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's
...