Array of objects within class in PHP

后端 未结 6 1924
没有蜡笔的小新
没有蜡笔的小新 2020-12-22 04:52

I recently realized my currently approach on a project would greatly improve with the use of better/more descriptive objects. As such, I realized that I want an array of obj

6条回答
  •  醉酒成梦
    2020-12-22 05:32

    Just include

    public $matches = array();
    

    Then when you want to add to the the array:

    $matches[] = $match;   // $match being object of type match
    

提交回复
热议问题