PHP Multidimensional Look for key=>value and return key?
<p>I am trying to do a search of a multidimensional array in order to append stuff to specific elements. I got a function that does a search and returns the specific part of that array, but I need the key so I can do <code>$array[key]</code> edits.</p>

<p>Function to get array</p>

<pre><code>function arraySearch($array, $key, $value)
{
    $results = array();
    if (is_array($array))
    {
        if (isset($array[$key]) &amp;&amp; $array[$key] == $value)
            $results[] = $array;
        foreach ($array as $subarray)
            $results = array_merge($results, arraySearch($subarray, $key, $value));
    }
    return $results;
}
</code></pre>

<p>I don't really know how to edit this to get the key from the array.</p>
