I have the following code.. and I know it's probably all wrong, but I haven't dealt with foreach loops before.
$last_names = regapiGetLastNames( NULL, -1 );
foreach ($last_names as $name => $last_name_id)
$exclude = array('11196','11195','11198','11197');
if(!in_array($name->last_name_id, $exclude)):
print '<option value="'.$last_name_id.'">'.$name.'</option>';
Obviously its going wrong somewhere, any help pls?