正则替换 <br />,为 "\r\n" $str = "1234567<br />1234567<br />1234567"; echo preg_replace("/<br\s*\/?>/i","\r\n",$str);