With this code:
$template["letras"][] = $letras;
$template["animales"][] = $animales;
$template = array(
"letras" => array("a"=>1, "b"=>2, "c"=>3), //sin comillas al cierre
"animales" => array("leon"=>1, "vaca"=>2, "cabra"=>3)
);
foreach ($template as $features => $features_value) {
${$features."_inner"} = $features_value;
}
It generates an array like this:
$letras_inner = array(0 => $features_value);
// $letras_inner = array(0 => array(3) => array("a"=>1, "b"=>2, "c"=>3))
I hope to get this:
$letras_inner_inner = $features_value;
// $letras_inner = array("a"=>1, "b"=>2, "c"=>3))
How can I make the assigned array not become a subarray of index zero, but save it directly?