I'm trying to get an array of the arrays in an inner foreach loop.
My code looks something like this:
foreach ( $parent_terms as $parent_term ) {
$outer_array = array();
foreach ( $child_terms as $child_term ) {
$inner_array = array();
$inner = 'something';
$inner_array[] = $inner;
$outer_array[] = $inner_array;
print_r($inner_array);
}
print_r($outer_array);
}
when I print outer array it starts again for each inner array.
$child_terms? how does$parent_termscontains?$outer_array = array();. Can you share a demo of your issue and your expected output?