Link to home
Start Free TrialLog in
Avatar of Ivan Esguerra
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"]].
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial