i have two arrays $schoolteachers and $schoolgroups...
$schoolgroups=Array ( [0] = Array ( [groupid] = 1 [groupname] =Red [members] = Array ( [0] = Array ( [id] = 13 [name] = Sooraj )
[1] = Array ( [id] = 12 [name] = sanjay ) ) ) [1] => Array ( [groupid] = 2 [groupname] = Blue [members] = Array ( [0] = Array ( [id] = 9 [name] = Anith ) [1] = Array ( [id] = 4 [name] = John ) );
$schoolteachers=Array (
[0] => Array ( [employee_id] = 7 [emp_name] = Anantha Raman ) [1] => Array ( [employee_id] => 9 [emp_name] = Anith ) [2] = Array ( [employee_id] = 11 [emp_name] = Aravind ) });
i want to check $schoolteachers 'empname',is in schoolgroup array($schoolgroup ['members'][''name]=Aravind) and echo only non members i want to display name based $schoolteachers array if it is not present in $schoolgroups
I used the code it's not fine
foreach ($schoolteachers as $teachers) {
$classin = false;
foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($schoolgroups)) as $value) {
if ($value == $teachers['emp_name']) {
$classin = true;
break;
}
}
if (!$classin) {
echo $teachers['emp_name'];
}
}