quoting constants in php: “this is a MY_CONSTANT”
问题 I want to use a constant in PHP, but I also want to put it inside double quotes like a variable. Is this at all possible? define("TESTER", "World!"); echo "Hello, TESTER"; obviously outputs "Hello, TESTER", but what I really want is something like: $tester = "World!"; echo "Hello, $tester"; outputs "Hello, World!". 回答1: Sorry, that's not the way constants in PHP work. You can put variables in double quotes and heredocs but not constants. 回答2: I recomend you to use concatenation because: When