Please I tried comparing values in two arrays using in_array(). $friends[] contains all ids of my friends in the friends table while $membersarray[] contains ids of people in a team.
What i'am trying to do here using in_array() is that I want only friends ids who are not part of the team to show up and it worked. But now, I want the result ($t) to display the surnames stored in the friends table instead of just the ids.
For example, it shows: 3, 5 and 7. I want it to show, 'john', 'doe' and 'rick'. How do I do this?
$friends[] = $record5['id']; //contains of ids of all friends
$membersarray[] = $output['id']; //contains ids of all team members
foreach ($friends AS $t) {
if (in_array($t, $membersarray)) {
//donothing
} else {
echo $t;
}
}
php