I have a list of triangles each traingle has an id, perimeter and area.
I need to implement functions to find triangle in the list based on one of the parameters (id or perimeter or area).
The question is how to store the list in this case? I am looking for something simple, which will make these functions small.
I tried to use
$triangleList[$id] = [$area,$perimeter];
for each triangle to build assoc. array. But now a can't easily find the triangle based on area or perimeter (must use foreach, in_array is not enough).
Is there a simple way to do that?