I’m newbie to PHP and CodeIgniter. So I have a database query result like this:
Result = array(
A = array(
[a]=>'1',
[b] =>'2',
);
B = array(
[a] =>'1',
[b] =>'3',
);
C = array(
[a] =>'1',
[b] =>'4',
);
**and more...**
);
So how can I merge them into one array like this:
Result = array(
Z = array(
[a] =>'1',
[b] => array(
[0] =>'2',
[1] =>'3',
[2] =>'4',
);
);
Thanks you so much…
OUTPUT
If you want unique values per key, for instance if you want to avoid
aequallingarray(1, 1, 2), then you can do this: