PHP remove newline in string inside html tag : I'm not good at regex and I need a quick answer for solving this problem. how to remove newline in string inside html tag using php, something like this:

input:

    <li>first line</li>
    <li>second 
    line</li>
    <li>third 
    line and 
    the last</li>

output:

    <li>first line</li>
    <li>second line</li>
    <li>third line and the last</li>

