I'm a bit confused with the array that I have to work with. The following array:
print_r($myArray);
returns the following:
Array (
[0] => stdClass Object (
[id] => 88
[label] => Bus
)
[1] => stdClass Object (
[id] => 89
[label] => Bike
)
[2] => stdClass Object (
[id] => 90
[label] => Plane
)
[3] => stdClass Object (
[id] => 91
[label] => Submaine
)
[4] => stdClass Object (
[id] => 92
[label] => Boat
)
[5] => stdClass Object (
[id] => 93
[label] => Car
)
[6] => stdClass Object (
[id] => 94
[label] => Truck
)
)
How do I get the label value, say, "Submaine", if I have the $id = 91?
$item = $myArray[$id];