您好,欢迎访问一九零五行业门户网

如何去掉字符串首尾部一个或多个换行符<br />

怎么去掉字符串首尾部一个或多个换行符
怎么去掉字符串尾部一个或多个换行符
$str=“
文字
;
$str=preg_replace(/^[
]+|[
]+$/,,$str);
怎么写才正确?
------解决方案--------------------
$str = str_replace('
','',$str);
------解决方案--------------------
php code

html;echo preg_replace('/(^(
\s*)+)|((
\s*)+$)/is','',$str);

其它类似信息

推荐信息