<?php $string = <<<HTML <p>my text 1</p> some other content <p>some other paragraph followed by an html line break</p><br> etc... HTML; $string = preg_replace('~</?[a-z]+>\R(*SKIP)(*FAIL)|$~m', '<br>', $string); var_export($string); echo "\n----\n"; var_export(json_encode($string));
You have javascript disabled. You will not be able to edit any code.