Ivan Esguerra
asked on
group an array based on their key
Can someone give me an idea how to group these array of fruits byt color?
example:
associative array ["Mango" => "Green", "Strawberry" => "Red", "Lemon" => "Green"] should return ["Green" => ["Mango", "Lemon"], "Red" => ["Strawberry"]].
example:
associative array ["Mango" => "Green", "Strawberry" => "Red", "Lemon" => "Green"] should return ["Green" => ["Mango", "Lemon"], "Red" => ["Strawberry"]].
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.