創建類的實例後,我想要做的是能夠將該實例的名稱作爲函數調用。例如,考慮下面的類美孚: $bar = new Foo(5); // generates 5 random ints between 0-100
bar(3); // get the third int in the object bar
在PHP這甚至可能還是會涉及與解析器搞亂?提前致謝!
我是新來的CI。我有一個功能來訪問數據列表作爲類別。該功能是這樣的: public function get_category_tree()
{
$this->ci->db->where('is_display','1');
$query = $this->ci->db->get('product_categories');
if ($query->num_ro