br2nl
$html = 'this <br>is<br/>some<br />text <br />!';
$nl = preg_replace('#<br\s*/?>#i', "\n", $html);
echo $nl;
Matteoweb
$html = 'this <br>is<br/>some<br />text <br />!';
$nl = preg_replace('#<br\s*/?>#i', "\n", $html);
echo $nl;
$newlineTags = array(
'<br>',
'<br/>',
'<br />',
);
$str = str_ireplace($newlineTags, PHP_EOL, $str);
$newlineTags = array(
'<br>',
'<br/>',
'<br />',
);
$html = str_replace($newlineTags, PHP_EOL, $html);