How to access the values in associative array in yii2. Note that this array is return by the ArrayHelper. I want to access the value of project_id . I tried to use getColumn($array, 'project_id') property from the ArrayHelper class. But it throws: unidentified index project_id.
This below shown array is dumped using VarDumper of yii2:
[
[
[
'plot_id' => '9',
'plot_no' => '4',
'project_id' => '1',
'project' =>
[
'project_id' => '1',
'project_name' => 'City Dubaiq',
],
],
],
]
project_idin your example, and you have not specified which one you need. Do you need allproject_idvalues in a given array recursively?var_dump(). you don't even see the two first[0]keys... you should tryvar_dump($array), you would have understood right away how to access your variable