I don't know about PHP.
But does the nested array only has 3 items. If that is so, maybe you can directly access the index. Or if it is not, reiterate the array to print the value based on the ID.
Anyway, you should have posted this question on Stackoverflow.