SyntaxFix
Write A Post
Hire A Developer
Questions
Using array_column to re-index will save time if you need to find multiple times:
$lookup = array_column($arr, NULL, 'id'); // re-index by 'id'
Then you can simply $lookup[$id] at will.
$lookup[$id]