gtal3x Posted November 12, 2007 Share Posted November 12, 2007 Hello i have got an array for countries $country_list = array( "1" => "Afghanistan", "2" => "Albania", "3" => "Algeria", "4" => "Andorra", ......................... What i wont to do is to add an extra value to the array wich would be the icon of each country something like that: "4" => "Andorra" => "an.gif", is it possible? if yes is it a good way to do it (i mean would it be easy for printing the results) or sould i do another array just for the flags? Link to comment https://forums.phpfreaks.com/topic/76925-solved-simple-array-question/ Share on other sites More sharing options...
teng84 Posted November 12, 2007 Share Posted November 12, 2007 remove the number in your array only do thid $array =array ('country'=>'phil.jpeg', etc....) Link to comment https://forums.phpfreaks.com/topic/76925-solved-simple-array-question/#findComment-389503 Share on other sites More sharing options...
emehrkay Posted November 12, 2007 Share Posted November 12, 2007 teng84 is correct, but not too clear. try this $country_list = array( 'Afghanistan' => array('icon' => 'an.gif', 'population' => 12345) }; access it like $country_list['Afghanistan']['icon']; etc Link to comment https://forums.phpfreaks.com/topic/76925-solved-simple-array-question/#findComment-389504 Share on other sites More sharing options...
gtal3x Posted November 12, 2007 Author Share Posted November 12, 2007 thnx alot thats wat i need Link to comment https://forums.phpfreaks.com/topic/76925-solved-simple-array-question/#findComment-389505 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.