I think this can be solve using RegEX, I think so, but I have no idea
Let say I have some variable like this:
$var1 = "cheap"
$var2 = "32"
$var3 = "6"
$var4 = "6"
$var5 = "8"
$maintext = "price is cheap, 16 button, 3 lines, size is 5k x 10k"
I need to check those var against the maintext.
For $var1, find and replace word after "price is ".
For $var2, find and replace word before "button"
For $var3, find and replace word before "lines"
For $var4 dan $var5, find and replace word after "size is "
So the final text will become: ""price is cheap, 32 button, 6 lines, size is 6k x 8k"
If not found the pattern, do not replace any text/words/string.
Any help and code example would be very appreciated
Thanks!