これはvar_dump($options)
array (size=4)
0 => string '2' (length=1)
'parent_2_children' =>
array (size=3)
0 => string '22' (length=2)
1 => string '24' (length=2)
2 => string '23' (length=2)
1 => string '3' (length=1)
'parent_3_children' =>
array (size=3)
0 => string '26' (length=2)
1 => string '25' (length=2)
2 => string '27' (length=2)
私が今まで試したことは、
if(!is_null($options))
{
foreach($options as $option)
{
if(!array_key_exists('parent_'.$option.'_children',$options))
{
//if position null output an error
}
}
}
要求に応じて Print_r()
Array
(
[0] => 2
[parent_2_children] => Array
(
[0] => 22
[1] => 24
[2] => 23
)
[1] => 3
[parent_3_children] => Array
(
[0] => 26
[1] => 25
[2] => 27
)
)