How can I use the value of a variable as constant?

后端 未结 3 1123
花落未央
花落未央 2021-01-16 00:38
  1. I have a PHP site which uses language system based on \"define\" method. For example:

    define(\"_question_1\", \"How old are you?\");
    define(\"_quest         
    
    
            
3条回答
  •  一生所求
    2021-01-16 01:08

    Just use constant() to use your variable value as constant, e.g.

    echo constant($a);
    

提交回复
热议问题