The task is to create a variable (string) in which there will be variables that will be replaced with a value during the output.
Like that:
$s1 = "it's $s2 !"; $s2 = 'OK'; echo $s1; //не работает echo "it's $s2 !"; //должно работать так Maybe I'm not right approach to solving the problem. Line $ s1 is a piece of HTML code that is output in a loop and the variable $ s2 is constantly changing. Actually, I know how to solve using a function, but the variant with variables seemed more elegant to me.
$s2variable must exist when you create$s1, since it is used in the contents. - Visman$sign when creating the first variable? Or also not? - Visman