I want to be able to group Associative Arrays
with their `keys. So far I'm lost of what syntax to use.
As of now, I have thus code,
$associativeArray = array("Ripe Mango"=>"Yellow", "Strawberry"=>"Red", "Lemon"=>"Yellow");
groupByColor($associativeArray);
function groupByColor($groupedArray)
{
return $groupedArray;
}
My goal is to return the array
while having it grouped, the ideal result will be like this;
["Yellow"=>["Ripe Mango", "Lemon"], "Red"=>["Strawberry"]]
Any hints on what method to use?