When to use a Class vs. Function in PHP

后端 未结 6 1968
长发绾君心
长发绾君心 2020-12-02 08:59

The lightbulb has yet to go on for this...

I\'d really love an easy to understand explanation of the advantage to using a class in php over just using functions. <

6条回答
  •  清歌不尽
    2020-12-02 09:55

    Basically Both Do same work but by using classes you can manage your code in easier way, One more thing if we use class then we have to create object for calling functions define in it, while if we create functions directly then we don't need to create object.

提交回复
热议问题