removing an element from multidimentional array php
<p>I am trying to remove an element from a multidimentional array in PHP. Here is the code :</p>

<pre><code>&lt;?php

$tset = "ST3"; 
$gettc = "gettingtc1"; 
$getbid = "gettingbid1"; 
$getresultsid = "gettingresid1"; 


$users[$tset] = array();


$users[$tset][] = array( "testcase"=&gt;"$gettc", 
                         "buildid"=&gt;"$getbid", 
                         "resultsid"=&gt;"$getresultsid"  
                  ); 


$tset = "TEJ"; 
$gettc = "ggettingtc2"; 
$getbid = "gettingbid2"; 
$getresultsid = "gettingresid2"; 



$users[$tset][] = array( "testcase"=&gt;"$gettc", 
                         "buildid"=&gt;"$getbid", 
                         "resultsid"=&gt;"$getresultsid"  
                  ); 


$tset = "ST3"; 
$gettc = "ggettingtc12"; 
$getbid = "gettingbid13"; 
$getresultsid = "gettigresid14"; 

$users[$tset][] = array( "testcase"=&gt;"$gettc", 
                         "buildid"=&gt;"$getbid", 
                         "resultsid"=&gt;"$getresultsid"  
                  ); 

                  foreach ($users as $val =&gt; $yy)
                  {
                  echo "For $val the array is :";
                  foreach($yy as $uy)
                  {
                  echo $uy['testcase'].$uy['buildid'].$uy['resultsid'];

                  }
                  echo '&lt;br&gt;';
                  }


                 $ser = "gettingresid1";

$to = array_searchRecursive($ser,$users);
if($to &lt;&gt; 0)
{
print_r($to);
}

else
{
echo "not";
}


function array_searchRecursive( $needle, $haystack, $strict=true, $path=array() )
{
    if( !is_array($haystack) ) {
        return false;
    }

    foreach( $haystack as $key =&gt; $val ) {
        if( is_array($val) &amp;&amp; $subPath = array_searchRecursive($needle, $val, $strict, $path) ) {
            $path = array_merge($path, array($key), $subPath);
            return $path;
        } elseif( (!$strict &amp;&amp; $val == $needle) || ($strict &amp;&amp; $val === $needle) ) {
            $path[] = $key;
            return $path;
        }
    }
    return false;
} 

?&gt;
</code></pre>

<p>Where I am stuck is : <code>$to</code> holds the array that has my search element. But the results <code>$to</code> is holding should be removed from the original array <code>$users</code>.</p>

<p>Any help.</p>

<p>Thanks.</p>
