audittr180 Posted May 29, 2011 Share Posted May 29, 2011 i have the following array $fruits = array("cherry" => "red", "apple" => "red", "kiwi" => "green", "strawberry" => "red", "pear" => "yellow", "melon" => "green", "grapes" => "green", "watermelon" => "red", "banana" => "yellow") using the array_count_values($fruits) i get Array ( => 4 => 3 [yellow] => 2 ) how can i asign the value of each key to a variable? Quote Link to comment https://forums.phpfreaks.com/topic/237764-asign-a-variable-to-an-array-value/ 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.