【发布时间】:2016-03-01 11:50:21
【问题描述】:
$result=array(
[0]=>array
(
[jobseeker_id] => 85
[jobtype] => 13
[sid] => 85
))
[1]=>array
(
[jobseeker_id] => 87
[jobtype] => 11
[sid] => 87
))
[2]=>array
(
[jobseeker_id] => 85
[jobtype] => 8
[sid] => 85
))
require output=
$result=array(
[0]=>array
(
[0]=>array(
[jobseeker_id] => 85
[jobtype] => 13
[sid] => 85
)
[1]=>array(
[jobseeker_id] => 85
[jobtype] => 11
[sid] => 85
)
[2]=>array
(
[jobseeker_id] => 87
[jobtype] => 8
[sid] => 87
));
我想获得最终的数组,其中所有的 jobseeker 作为它的父键以及它的子数组中的作业。就像如果求职者 85 有 2 个工作数组应该是 $final_array[85][0] = Job one for 85; $final_array[85][1] = 85 的作业二; $final_array[51][0] = 51 的工作一; 像这样
【问题讨论】:
-
也许你想做这样的事情? stackoverflow.com/a/33905018/1129198
-
你能看懂你写了什么吗?
标签: php mysql codeigniter