$cripts Posted February 19, 2007 Share Posted February 19, 2007 I have An Array Array ( [0] => games, [teams] => Array ( [0] => gameid ) ); The problem im having is I made a function to implode this array foreach($array as $parent) { if(is_array($parent)) { while(list($key, $value) = each($parent)) { echo $key.value; } } else { echo $parent; } } From this i can only get 0,gameid,games While i need to get team,gameid,games and i cannot fiqure out how to do this.... Link to comment https://forums.phpfreaks.com/topic/39150-multi-deminsional-arrays/ Share on other sites More sharing options...
superuser2 Posted February 19, 2007 Share Posted February 19, 2007 Look at print_r: http://php.net/print_r Link to comment https://forums.phpfreaks.com/topic/39150-multi-deminsional-arrays/#findComment-188531 Share on other sites More sharing options...
$cripts Posted February 19, 2007 Author Share Posted February 19, 2007 print_r will print out an array so we can read it..... wut i need to do is implode this array into games|team,gameid so i can go back later and explode it back into its original array Link to comment https://forums.phpfreaks.com/topic/39150-multi-deminsional-arrays/#findComment-188547 Share on other sites More sharing options...
kenrbnsn Posted February 19, 2007 Share Posted February 19, 2007 What you probably want is the serialize() function. Ken Link to comment https://forums.phpfreaks.com/topic/39150-multi-deminsional-arrays/#findComment-188599 Share on other sites More sharing options...
boo_lolly Posted February 19, 2007 Share Posted February 19, 2007 also, have a look at array_keys() and array_values(). Link to comment https://forums.phpfreaks.com/topic/39150-multi-deminsional-arrays/#findComment-188669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.