Самый простой способ -
define('MY_CONSTANT', 42);
$my_constant = MY_CONSTANT;
echo "This is my constant: $my_constant";
Другой способ использования (s)printf
define('MY_CONSTANT', 42);
// Note that %d is for numeric values. Use %s when constant is a string
printf('This is my constant: %d', MY_CONSTANT);
// Or if you want to use the string.
$my_string = sprintf('This is my constant: %d', MY_CONSTANT);
echo $my_string;