【发布时间】:2018-11-20 07:08:42
【问题描述】:
我现在的情况真的很复杂。
在这里我必须将多维数组数据导出到 excel 中,如下图所示,但我无法做到。
请帮我将多维数组数据导出到excel中。
我有一个来自关系查询的数组,例如:
$array = [
0 => [
'name' => 'Devat Karetha',
],
1 => [
'name' => 'John Doe',
'schools' => [
0 => [
'school_name' => 'ABC School',
'school_address' => 'ABC Address',
],
1 => [
'school_name' => 'XYZ School',
'school_address' => 'XYZ Address',
]
],
'sports' => [
0 => [
'id' => 8,
'sport_type' => [
'id' => 2
'sport_type_name' => 'ABC Sport'
],
],
1 => [
'id' => 8,
'sport_type' => [
'id' => 3
'sport_type_name' => 'ABC Sport'
],
],
],
],
2 => [
'name' => 'Utkarsh Raval',
'schools' => [],
'sports' => [
0 => [
'id' => 8,
'sport_type' => [
'id' => 2
'sport_type_name' => 'DEKTS Sport'
],
],
],
'centre' => [
0 => [
'id' => 4,
'centre_name' => 'ABC Centre',
'centre_mobile' => '9898989898',
],
1 => [
'id' => 5,
'centre_name' => 'XYZ Centre',
'centre_mobile' => '7878787878',
],
]
],
];
谢谢你...:)
【问题讨论】:
标签: arrays laravel collections foreach export-to-excel