usort function in a class

后端 未结 6 1205
孤城傲影
孤城傲影 2020-12-24 06:13

I have a function which sorts data in a multidimensional array, as shown below:

 \"James\");  
         


        
6条回答
  •  生来不讨喜
    2020-12-24 06:38

     usort($data, array($this,"order_new"));
    

    is what you want when referring to a function in your class instance. See callable

    A method of an instantiated object is passed as an array containing an object at index 0 and the method name at index 1.

提交回复
热议问题