traversing an array in php [duplicate]
Possible Duplicate: Loop an array of array So I know how to traverse an array of even key => value (associative), but I have a weird array where I need to walk through it and print out values: $object_array = array( 'type' => 'I am type', array( 'property' => 'value', 'property_2' => 'value_2' ) ); What I thought I could do is: foreach($object as $key=>$vlaue){ //what now? } So as you can see I am lost, how do I walk through the next array? foreach($object as $key=>$value){ if( is_array($value) ) { foreach($value as $key2=>$value2) { //stuff happens } } else { //other stuff ] } You can try: