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? Quote Link to comment 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....) Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
gtal3x Posted November 12, 2007 Author Share Posted November 12, 2007 thnx alot thats wat i need Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.