global variables in php not working as expected

后端 未结 7 1805
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 07:33

I\'m having trouble with global variables in php. I have a $screen var set in one file, which requires another file that calls an initSession() def

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 07:39

    It is useless till it is in the function or a class. Global means that you can use a variable in any part of program. So if the global is not contained in the function or a class there is no use of using Global

提交回复
热议问题