My code is
preg_replace("/([^; ]+)=>([^; ]+)/", "ec_set('$1',$2);", $input_lines);
on matching the following text
test=>1; test; test=>123;
asdf
test=>[[test]]
The result
is outputting over-lines
ec_set('test',1);; test; ec_set('test',123);; ec_set('
asdf
test',[[test]]);
How to make it
ec_set('test',1);; test; ec_set('test',123);;
asdf
ec_set('test',[[test]]);
?
尝试这个:
preg_replace("/([^;\\n ]+)=>([^;\\n ]+)/", "ec_set('$1',$2);", $input_lines);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.