I've recently come across a bit of a problem about concatenating two string almost identically, but one would have more text than the other. Here is what I want to achieve and tried :
$var1 = $var2 = "the sky is ";
$var1 .= "grey and ";
$var1 .= $var2 .= "blue";
Obviously this will not work but the desired result is :
$var 1 : "the sky is grey and blue"
$var 2 : "the sky is blue"
Another operation wouldn't be much here but it's more about knowing if it is possible.
I could make a third temporary var but I was wondering if i could avoid it, other solutions would have been to have only 1 variable and remove with substring operations.
$var2 .= "blue"then$var1 .= (result of preceding)