keep the original string format after modified?
$source1= "03aaa\r\n
04bbb\r\n
05ccc\r\n
04eee\r\n
05fff\r\n
04ggg\r\n
05hhh\r\n
08eee\r\n"
Can be
$source2= "03aaa04bbb05ccc04eee05fff04ggg05hhh08eee"
I want to keep the original format(if there are linebreak keep it like origin) after I made modified(added 07) the $source .
if input is like source1 format:
ouput:
$source1= "03aaa\r\n
04bbb\r\n
05ccc\r\n
04eee\r\n
05fff\r\n
07fff\r\n
04ggg\r\n
05hhh\r\n
07hhh\r\n
08eee\r\n"
if input is like source2 format:
$source2= "03aaa04bbb05ccc07fff04eee05fff07fff04ggg05hhh007fff8eee"
How Can I got the expected result and keep the format like the origin?
Anyone could help me please?
thanks
Use single quotes to avoid translating special characters and variables.