我有一个像这样的订单数据表
123.- sumi hai
bla
124.- the
secod line
is blah
125.- another line
使用php preg_replace()
尝试得到的是这样的东西123.- sumi hai blah
124.- the second line is blah
125.- another line
请帮助我 提前致谢
答案 0 :(得分:2)
你可以使用这样的正则表达式:
\n^(?=[a-z])
<强> Working demo 强>
$str = '123.- sumi hai
bla
124.- the
secod line
is blah
125.- another line';
$result = preg_replace('/\n^(?=[a-z])/m', ' ', $str);
echo "The result of the substitution is ".$result;