You can achieve your expected outcome like below:-
<?php
$data = array(
array(1 => array("A ROW GREENS", array(
"A1" => array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg"),
"A2" => array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg"),
"A3" => array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg")
))),
array(2 => array("A ROW BLUE",array(
"A1" => array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg"),
"A2" => array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg"),
"A3" => array("http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg")
))));
$parent_data = '';
$child_data = '';
foreach($data as $dat){
foreach($dat as $key=>$da){
$parent_data .="<li id ='".$key."'>".$da[0]."</li>";
$child_data .="<ul id='child".$key."'>";
foreach ($da[1] as $k=>$v){
$child_data .="<li id='child".$key."-".$k."'>".$v[0]."</li>";
}
$child_data .="</ul>";
}
}
?>
<ul id="parent"><?php echo $parent_data;?></ul><?php echo $child_data;?>
Output:- https://eval.in/656522
Note:- The code will only work for the given array structure (element can be more, no problem), But if array structure is changed then code will not work.