quoting constants in php: “this is a MY_CONSTANT”

前端 未结 6 1637
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-06 09:58

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!\");
ech         


        
6条回答
  •  日久生厌
    2020-12-06 10:31

    Sorry, that's not the way constants in PHP work. You can put variables in double quotes and heredocs but not constants.

提交回复
热议问题