I am new to PHP Codeigniter. I have a database inner join query in that I am fetching category id, category name, subcategory id and subcategory name as shown below.
e.g. http://i.stack.imgur.com/KbrkF.png
I am figuring out the way to create multidimensional array with category id, name and subcategories details as an in it.
e.g.
Array[0]=>Array ( [category_id] => 1 [category_name] => Computer [sub] =>
Array ([0]=> [subcategory_id] => 1 [subcategory_name] => C Programming )
[1]=> [subcategory_id] => 2 [subcategory_name] => Website Development)
[2]=> [subcategory_id] => 4 [subcategory_name] => Java))
Array[1]=>Array ( [category_id] => 2 [category_name] => Robotics [sub] =>
Array ( [subcategory_id] => 3 [subcategory_name] => Robo Wars))
Thanks