I'm trying to get a dynamic multidimensional array that can have unlimited ammounts of keys down based on a database. $sm_array = array();
while ($fetch = mysql_fetch_object($results)) {
if (count(explode("-", $fetch->parent)) >=2){
$exp = explode("-", $fetch->parent);
$test = "";
foreach ($exp as $key=>$val){
$test .= "[$val]";
$sm_array{$test}[$fetch->id]= "$fetch->title";
}
}
if fetch->parent is something like "test-test-test"
then the key in sm_array ends up being
[[test][test][test]] => Array
()
Is it possible to do what I am trying to do, or does anyone know a better way? (this structure at most will be 5 deep but I don't want to limit it)