Converting a string to a defined constant in PHP

后端 未结 1 677
陌清茗
陌清茗 2021-02-07 00:03

Let\'s say I have defined the constant ERROR_0 as follows:

define("ERROR_0","An error occurred.")

Now, let\'s sa

1条回答
  •  萌比男神i
    2021-02-07 00:31

    Use constant function

    echo constant("ERROR_0");
    

    0 讨论(0)
提交回复
热议问题