jwk811 Posted November 27, 2006 Share Posted November 27, 2006 [code]$families = array( "Griffin"=>array ( "Peter", "Lois", "Megan", ), "Quagmire"=>array ( "Glenn" ), "Brown"=>array ( "Cleveland", "Loretta", "Junior" ));[/code] Link to comment https://forums.phpfreaks.com/topic/28578-how-can-you-call-a-piece-from-this-kind-of-array/ Share on other sites More sharing options...
fert Posted November 27, 2006 Share Posted November 27, 2006 $families[Griffin][Peter] Link to comment https://forums.phpfreaks.com/topic/28578-how-can-you-call-a-piece-from-this-kind-of-array/#findComment-130752 Share on other sites More sharing options...
ToonMariner Posted November 27, 2006 Share Posted November 27, 2006 griffin is indeed an index on the array but peter is not - its a value.so to get Peter you'd need $families['Griffin'][0] Link to comment https://forums.phpfreaks.com/topic/28578-how-can-you-call-a-piece-from-this-kind-of-array/#findComment-130759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.