Where is the mistake in this code? : <p>I'm a noobie in php, so I got this code from my teacher and I can't get the answer. Can somebody explain me where is the mistake is this code?</p>

<pre><code>&lt;?php
function XXX($array, $val) {
foreach ($array as $key =&gt; $value) {
 if ($value == $val) {
 unset($value);
  return $key;
  break;
 }
}
 return FALSE;
}
</code></pre>
