Class library, how to use it, is there any detailed method?
哈哈哈哈。
哈哈哈哈。 2018-07-12 11:54:40
0
6
1286

My MySQL class library in PHP can only define variables after loading it with include. How to use the functions in it? It is useless to write the function name directly.

Please give me a detailed method. Thank you

哈哈哈哈。
哈哈哈哈。

reply all(3)
You bad bad

Class libraries are generally used for inheritance. Your own project class inherits the extends class library. In this way, you can use the methods and things inside it in your own class. Do you understand this?

Summer

You can take a look at this: https://blog.csdn.net/toume/article/details/80995979

  • reply I think only referring to it is equivalent to loading But it doesn't say how to use the functions inside. What should I add before using the function inside? I don’t know mainly this.
    哈哈哈哈。 author 2018-07-12 12:51:31
  • reply When you create a new object, just use the object to call the method in the class; for example, $a = new b(); $c = $a->d(); $c is what class b gets after calling class d method of class b. the result of;
    Summer author 2018-07-12 14:14:11
  • reply Thank you very much, I understand. Thank you
    哈哈哈哈。 author 2018-07-12 15:12:29
无忌哥哥

Directly copy the code encapsulated in the class library into your program, and then call it.

  • reply Should I copy it directly? Can't I use include to load it? Is it written like this? If I copy it directly, it will feel very bloated.
    哈哈哈哈。 author 2018-07-12 12:01:39
  • reply Include is also OK
    无忌哥哥 author 2018-07-12 13:33:35
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template