三维数组如下:
Array
(
[0] => Array
(
[0] => Array
(
[id] => 1
[project] => 美的空调
[pro_money] => 3000022.00
[corp_name] => 美的
[status] => 2
[address] => 深圳宝安区
[position] => 总经理
[name] => 无名
[telphone] => 0524-8569623
[mobile] => 18859685952
[email] => 89343432@qq.com
[first_money] => 10000.00
[last_money] => 20000.00
[business] => 张三
[help_man] => 李铭
[check_time] => 2019-11-25
[check_setup] => 广东审核机构
[last_check_time] => 2019-11-25
[admin_id] => 5
[create_time] => 2019-11-25 15:00:41
)
)
[1] => Array
(
[0] => Array
(
[id] => 3
[project] => 天龙项目
[pro_money] => 1000000.00
[corp_name] => 沃尔沃
[status] => 1
[address] => 天津冰海新区
[position] => 经理
[name] => 李海
[telphone] => 0665-5263968
[mobile] => 13856985210
[email] => 89343432@qq.com
[first_money] => 500000.00
[last_money] => 500000.00
[business] => 李四
[help_man] => 刘开
[check_time] => 2019-12-03
[check_setup] => 北大机构
[last_check_time] => 2019-12-03
[admin_id] => 7
[create_time] => 2019-12-03 15:30:06
)
[1] => Array
(
[id] => 2
[project] => 测试项目265
[pro_money] => 1000000.00
[corp_name] => 三星
[status] => 1
[address] => 广州珠海区
[position] => 总监
[name] => 张琴
[telphone] => 0795-6859623
[mobile] => 18645236895
[email] => 89343432@qq.com
[first_money] => 500000.00
[last_money] => 500000.00
[business] => 李四
[help_man] => 王经
[check_time] => 2019-11-25
[check_setup] => 北大机构
[last_check_time] => 2019-11-25
[admin_id] => 7
[create_time] => 2019-11-25 14:59:52
)
)
)
需要转换后的结果:
Array
(
[0] => Array
(
[id] => 1
[project] => 美的空调
[pro_money] => 3000022.00
[corp_name] => 美的
[status] => 2
[address] => 深圳宝安区
[position] => 总经理
[name] => 无名
[telphone] => 0524-8569623
[mobile] => 18859685952
[email] => 89343432@qq.com
[first_money] => 10000.00
[last_money] => 20000.00
[business] => 张三
[help_man] => 李铭
[check_time] => 2019-11-25
[check_setup] => 广东审核机构
[last_check_time] => 2019-11-25
[admin_id] => 5
[create_time] => 2019-11-25 15:00:41
)
[1] => Array
(
[id] => 3
[project] => 天龙项目
[pro_money] => 1000000.00
[corp_name] => 沃尔沃
[status] => 1
[address] => 天津冰海新区
[position] => 经理
[name] => 李海
[telphone] => 0665-5263968
[mobile] => 13856985210
[email] => 89343432@qq.com
[first_money] => 500000.00
[last_money] => 500000.00
[business] => 李四
[help_man] => 刘开
[check_time] => 2019-12-03
[check_setup] => 北大机构
[last_check_time] => 2019-12-03
[admin_id] => 7
[create_time] => 2019-12-03 15:30:06
)
[2] => Array
(
[id] => 2
[project] => 测试项目265
[pro_money] => 1000000.00
[corp_name] => 三星
[status] => 1
[address] => 广州珠海区
[position] => 总监
[name] => 张琴
[telphone] => 0795-6859623
[mobile] => 18645236895
[email] => 89343432@qq.com
[first_money] => 500000.00
[last_money] => 500000.00
[business] => 李四
[help_man] => 王经
[check_time] => 2019-11-25
[check_setup] => 北大机构
[last_check_time] => 2019-11-25
[admin_id] => 7
[create_time] => 2019-11-25 14:59:52
)
)
转换代码如下:
foreach ($list as $k => $map)
{
foreach ($map as $key => $maps)
{
$school_lists[] = $maps;
}
}
来源:CSDN
作者:do better myself
链接:https://blog.csdn.net/ahjxhy2010/article/details/104636107