Beispielobjektarray:
Code: Select all
$array = [
(object) ['id' => 'one', 'color' => 'white'],
(object) ['id' => 'two', 'color' => 'red'],
(object) ['id' => 'three', 'color' => 'blue']
];
Code: Select all
function findObjectById($id){
}
Code: Select all
$obj = findObjectById('one')
Mobile version