【发布时间】:2020-03-18 05:43:00
【问题描述】:
我正在尝试在 BLADE 文件中获取数组值。我的数组如下所示,但我无法在数组中获取值。
我有 [student_levels]=> [level] 数据
laravel 代码
foreach($items as $item)
{
echo $item['student_levels']['level'];
}
$items 是数组
Array
(
[0] => Array
(
[_id] => 5c1e4295b0dace71ec62e325
[email] => dhavalpansuriya1195@gmail.com
[franchisecode] => MELHH
[title] => Mr
[firstname] => dhaval s
[lastname] => patel
[gender] => Male
[age] => 16-18
[phone] => 9601354880
[address] => rajkot
[city] => Ahmedabad
[country] => India
[tempcode] => hUmoEF
[studentid] => HTNKLF
[updated_at] => 2019-11-21 13:32:31
[created_at] => 2018-12-22 19:26:37
[student_status] => eda
[student_levels] => Array
(
[_id] => 5c8b11d2b0dace2f9a044d86
[student_id] => HTNKLF
[teacher_id] => 5c1e1ab5b0dace716e429654
[level_name] => recomended_level
[level] => Level 1
[comments] => hhbhhhh
[exam_type] => eda
[student_course] =>
[updated_at] => 2019-03-15 08:15:38
[created_at] => 2019-03-15 08:15:38
)
)
【问题讨论】:
标签: php arrays laravel mongodb