Consider:
The value of my_const is {my_const}.
MYECHO;
?>
You can also approach the problem by assigning the value of the constant to a variable.
Personally I do it that way because if you have lots of constants in your string then your sprintf() call can be quite messy. It's also then harder to scan through the string and see what is doing what. Plus, by assigning the variables individually, you can see what is taking on what value.
An example would be:
$const = CONST;
$variable = VARIABLE;
$foo = (new Foo)->setFooProperty(12)->getFooProperty();
$bar = (123 - 456) * 10;
$ten = 1 + 2 + 1 + (5 - 4);
<<