【发布时间】:2022-01-10 10:02:50
【问题描述】:
以下代码在每个换行符后产生一个空格,我不知道为什么。请帮忙,我怎样才能在不添加空格的情况下实现相同的功能?
<?php
$test = "Hello World\nHello World";
$test = preg_replace ( "/([^\s]{80}?)/" , "\\1<br />" , trim ( nl2br ( strip_tags ( $test, '<br>' ) ) ) );
echo $test;`
?>
【问题讨论】: