Noe som dette kan fungere?
Kode
function findContact($obj) {
if (isset($obj->email) && $obj->email == "findthis@example.com")
{
return true;
}
return false;
}
$result = array_filter($contacts, 'findContact');
Sist endret av ptothep; 2. februar 2019 kl. 17:35.