I have two arrays.
Array
(
[0] => Array
(
[id] => 12
[user_id] => 1
[date] => 2013-10-21 23:01:52
[type] => 1
[name] => Wypłata UNDICOM
[quantity] => 0
[value] => 1700
)
[1] => Array
(
[id] => 13
[user_id] => 1
[date] => 2013-10-21 23:01:52
[type] => 0
[name] => Rata (gwarancja MacBook Air)
[quantity] => 0
[value] => 90
)
[2] => Array
(
[id] => 16
[user_id] => 1
[date] => 2013-10-21 23:01:52
[type] => 0
[name] => TESCO (zakupy)
[quantity] => 0
[value] => 0
)
)
Array
(
[0] => Array
(
[id] => 3
[data_id] => 16
[name] => Coca-Cola
[quantity] => 2
[value] => 5
)
[1] => Array
(
[id] => 4
[data_id] => 16
[name] => Pizza
[quantity] => 1
[value] => 10
)
)
I want to display this two arrays, but first array is a category and second have elements. The relations are between id (first array) and data_id (second array). In MySQL is simple LEFT JOIN, but i have no idea if is function like that in PHP. I just tried code some if's etc. but without success. I want a simple solution, so if it's impossibile then tell me that.
Cheers!