www.fltk.net > php根据换行分割字符串

php根据换行分割字符串

换行符咯 "\n"

或 双引号内的\n会被转义为换行符

你是要写正则验证吧?

输出结果为: 111 222

换行是 输出echo 结合起来 echo "";

$arr = explode("\n",$content);foreach($arr as $k=>$v){ $arr[$k] = trim($v);}print_r($arr);

str_replace('\r\n','',$str);

网站地图

All rights reserved Powered by www.fltk.net

copyright ©right 2010-2021。
www.fltk.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com