“BR2NL” Kode Jawaban

BR2NL

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

BR2NL

$newlineTags = array(
                '<br>',
                '<br/>',
                '<br />',
            );
            $str = str_ireplace($newlineTags, PHP_EOL, $str);
Matteoweb

BR2NL

$newlineTags = array(
  '<br>',
  '<br/>',
  '<br />',
);
$html = str_replace($newlineTags, PHP_EOL, $html);
Matteoweb

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya