create a multiselect dropdown with 3-story levels

Multi tool use
create a multiselect dropdown with 3-story levels
I am making a multi-story multiselect dropdown with 3 level, level 1 and 2 is successfully performed, but for level 3 error (error array to string).How to solve it?
I attach the following code:
model :
function getZonaTree2() {
$types = $this->getZonaType();
$tree = array(''=>'-- Region --');
$this->getListTreeParent($listZona, 0, 0);
foreach($listZona as $r) {
if($r->LEVEL==1) {
$tree[$r->ZONA_NAME] = array();
$zona_parent_1 = $r->ZONA_NAME;
}
if($r->LEVEL==2) {
$tree[$zona_parent_1][$r->ZONA_NAME] = array();
$zona_parent_2 = $r->ZONA_NAME;
}
if($r->LEVEL==3) {
$tree[$zona_parent_1][$zona_parent_2][$r->ZONA_ID] = $r->ZONA_NAME." (".$r->ZONA_CAPITAL.") - ".$types[$r->TYPE];
}
}
return $tree;
}
view :
<?php
echo form_multiselect('zona_id', $this->Zona_model->getZonaTree2(), array(), "size=8 id='zona_id'");
?>
display error :
the display should :
$this->Zona_model->getZonaTree2()
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
please provide a usable array example of the output of
$this->Zona_model->getZonaTree2()
... enough to replicate for example Sumatrera -> Aceh -> Aceh Barat or similar. I have limited knowledge of this function but it seems like it doesn't support as nested of an array as you have.– Alex
Jul 3 at 8:32