PHP Array Removing Matching Values
<p>I built this function in PHP so far called removeAllValuesMatching, but I cannot seem to get it working. I am passing in two parameters $arr and $value. Not sure why this is happening. Any help would be greatly appreciated. This is what I have so far:</p>

<pre><code>&lt;?php 
$arr = array(
   'a' =&gt; "one",
   'b' =&gt; "two",
   'c' =&gt; "three",
   'd' =&gt; "two",
   'e' =&gt; "four",
   'f' =&gt; "five",
   'g' =&gt; "three",
   'h' =&gt; "two"
);
function removeAllValuesMatching($arr, $value){
 foreach ($arr as $key =&gt; $value){
 if ($arr[$key] == $value){
 unset($arr[$key]);
 }
 }
 return $arr = array_values($arr);
 }

print_r(removeAllValuesMatching($arr, "two"));

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