search a value from an array based on another array
<p>i have two arrays $schoolteachers and $schoolgroups...</p>

<blockquote>
  <p>$schoolgroups=Array ( 
            [0] = Array
          ( 
   [groupid] = 1
              [groupname] =Red
              [members] = Array
                  (
                      [0] = Array
                          (
                              [id] = 13
                              [name] = Sooraj 
                          )</p>

<pre><code>                [1] = Array
                    (
                        [id] = 12
                        [name] = sanjay
                    )

            )

    )

[1] =&amp;gt; Array
    (
        [groupid] = 2
        [groupname] = Blue
        [members] = Array
            (
                [0] = Array
                    (
                        [id] = 9
                        [name] = Anith
                    )

                [1] = Array
                    (
                        [id] = 4
                        [name] = John
                    )

            ); 
</code></pre>
</blockquote>

<p>$schoolteachers=Array (</p>

<blockquote>
<pre><code>[0] =&amp;gt; Array
    (
        [employee_id] = 7
        [emp_name] = Anantha Raman
    )

[1] =&amp;gt; Array
    (
        [employee_id] =&amp;gt; 9
        [emp_name] = Anith
    )

[2] = Array
    (
        [employee_id] = 11
        [emp_name] = Aravind
    ) });
</code></pre>
</blockquote>

<p>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</p>

<p>I used the code it's not fine</p>

<pre><code>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'];
    }
}
</code></pre>
