I'am stuck and didn't found any tutorial or examples on how to produce the multidimensional array like this while using foreach():
'0' => '-- ALL --',
'CATEGORY 1' => array(
'11' => 'Item 11',
'12' => 'Item 12',
'13' => 'Item 13',
),
'CATEGORY 2' => array(
'14' => 'Item 14',
'15' => 'Item 15',
'16' => 'Item 16',
)
And this is where I'am stucked:
$items = $this->model->get_categories();
foreach($items as $item){
$result[$item->title] = array();
// HOW TO CONTINUE NEXT ? :(
}