Access a global variable in a PHP function

前端 未结 9 2014
感动是毒
感动是毒 2020-11-29 05:33

According to the most programming languages scope rules, I can access variables that are defined outside of functions inside them, but why doesn\'t this code work?



        
9条回答
  •  天涯浪人
    2020-11-29 06:16

    If you want, you can use the "define" function, but this function creates a constant which can't be changed once defined.

    
    

    PHP Constants

提交回复
热议问题