PHP正则表达式用等运算符替换新行

时间:2015-03-30 11:37:23

标签: php regex

我想从等于运算符替换字符串,然后将换行符替换为空格。

From String:-
 Dr/CR,Entry Amount,Value date,Product,Party Code,Party Name,Virtual=\nAccount Number,Locations,RemittingBank,UTR No\nC,500000.0000,30-Mar-15,ABC,XYZ,QWER =\nLTD,LKJH,

To String:- 
 Dr/CR,Entry Amount,Value date,Product,Party Code,Party Name,Virtual Account   Number,Locations,RemittingBank,UTR No\nC,500000.0000,30-Mar-15,ABC,XYZ,QWER  LTD,LKJH,

1 个答案:

答案 0 :(得分:2)

您可以使用preg_replace。

preg_replace('~=\n~', " ", $str);