<?php $objs = (object)[ 'data' => [ (object)['guestEmail' => 'bad@example.com'], (object)['guestEmail' => 'okay@goodstuff.com'], (object)['guestEmail' => 'nope@example1.com'] ] ]; $blacklist = ['@example.com', 'example1.com']; foreach ($objs->data as $row) { foreach ($blacklist as $forbidden_string) { if (stripos($row->guestEmail, $forbidden_string) !== false) { continue 2; } } $emails[] = $row->guestEmail; } var_export($emails);
You have javascript disabled. You will not be able to edit any code.