<?php $array = [ (object) ['id' => 'one', 'color' => 'white'], (object) ['id' => 'two', 'color' => 'red'], (object) ['id' => 'three', 'color' => 'blue'] ]; $find = 'one'; var_export( array_find( $array, fn($row) => $row->id === $find ) );
You have javascript disabled. You will not be able to edit any code.