echo preg_replace('~(\n)[\r\n]+|(<text>.*?</text>)~isu', '$1$2', $content);echo preg_replace('~[\r\n]+|<text>.*?</text>(*SKIP)(*F)~isu', "\n", $content);echo preg_replace('~<code>(.*?)(?=</code>)|<[^>]+>~siu', ' $1', $txt);echo preg_replace('~(?<=<code>).*?\K</code>|<[^>]+>~siu', ' ', $txt);