Hello,
I have a string like this:
var1: value1...valueI var2: value1...valueJ ... varN:
value1...valueK
this is an example:
breakfast: coffee eggs lunch: sandwich apple dinner: chicken wine
cake
I'm trying to use preg_replace to change "lunch:" values to a code
number, in order to get in the example:
breakfast: coffee eggs lunch: 0503 dinner: chicken wine cake
keeping the rest of variables and values unchanged.
Take in account, that I'm only sure that I have the "lunch:" word
delimitation (and its values), I don't know if exists "breakfast: " or
"dinner:"; but I'm sure that if the variable exists, then the values
exists too.
Thanks,
Sebastian.
I have a string like this:
var1: value1...valueI var2: value1...valueJ ... varN:
value1...valueK
this is an example:
breakfast: coffee eggs lunch: sandwich apple dinner: chicken wine
cake
I'm trying to use preg_replace to change "lunch:" values to a code
number, in order to get in the example:
breakfast: coffee eggs lunch: 0503 dinner: chicken wine cake
keeping the rest of variables and values unchanged.
Take in account, that I'm only sure that I have the "lunch:" word
delimitation (and its values), I don't know if exists "breakfast: " or
"dinner:"; but I'm sure that if the variable exists, then the values
exists too.
Thanks,
Sebastian.
Comment