How to define global functions in PHP

前端 未结 7 1285
陌清茗
陌清茗 2020-12-01 11:43

How can I define a global function which would be accessible from any page?

7条回答
  •  北海茫月
    2020-12-01 12:32

    To expand on luarwo's answer, you can declare the function right in your class constructor. This could make your class a sort of function library, where the functions are accessible from any page where you create your class instance.

    Sandbox\MyGameLib

    Seesaw

    The game Tempest is awesome

提交回复
热议问题