1
特定對象項我用下面的函數,其中$task
是TaskData
實例獲得來自陣列
var_dump(array_pop($task));
// outputs when used repeatdly:
object(TaskData)[18]
private 'id_task' => string '4' (length=1)
private 'name' => null
private 'process_id' => null
object(TaskData)[22]
private 'id_task' => string '9' (length=1)
private 'name' => null
private 'process_id' => null
object(TaskData)[27]
private 'id_task' => string '18' (length=2)
private 'name' => null
private 'process_id' => null
object(TaskData)[46]
private 'id_task' => string '42' (length=2)
private 'name' => null
private 'process_id' => null
object(TaskData)[18]
private 'id_task' => string '47' (length=2)
private 'name' => null
private 'process_id' => null
object(TaskData)[36]
private 'id_task' => string '57' (length=2)
private 'name' => null
private 'process_id' => null
object(TaskData)[35]
private 'id_task' => string '63' (length=2)
private 'name' => null
private 'process_id' => null
object(TaskData)[41]
private 'id_task' => string '68' (length=2)
private 'name' => null
private 'process_id' => null
object(TaskData)[26]
private 'id_task' => string '70' (length=2)
private 'name' => null
private 'process_id' => null
數組我如何可以訪問id_task項目(樣品中:'4','9','18','42'
)?
是'TaskData'你自己的班級? – 2015-04-02 07:50:49
是的,如果需要,我可以修改它。爲什麼? – Raccoon 2015-04-02 07:52:07
可能的重複[在PHP中,是否有一個函數返回由關聯數組中的一個鍵的值組成的數組?](http://stackoverflow.com/questions/10659875/in-php-is函數返回一個數組由一個鍵值組成) – 2015-04-02 08:03:13