title: PHP Remove elements from associative array
body: <p>I have an PHP array that looks something like this: </p>
  
  <pre><code>Index              Key     Value
  [0]                1       Awaiting for Confirmation
  [1]                2       Assigned
  [2]                3       In Progress
  [3]                4       Completed
  [4]                5       Mark As Spam
  </code></pre>
  
  <p>When I var_dump the array values i get this:</p>
  
  <pre><code>array(5) { [0]=&gt; array(2) { ["key"]=&gt; string(1) "1" ["value"]=&gt; string(25) "Awaiting for Confirmation" } [1]=&gt; array(2) { ["key"]=&gt; string(1) "2" ["value"]=&gt; string(9) "Assigned" } [2]=&gt; array(2) { ["key"]=&gt; string(1) "3" ["value"]=&gt; string(11) "In Progress" } [3]=&gt; array(2) { ["key"]=&gt; string(1) "4" ["value"]=&gt; string(9) "Completed" } [4]=&gt; array(2) { ["key"]=&gt; string(1) "5" ["value"]=&gt; string(12) "Mark As Spam" } }
  </code></pre>
  
  <p>I wanted to remove <strong>Completed</strong> and <strong>Mark As Spam</strong>. I know I can <code>unset[$array[3],$array[4])</code>, but the problem is that sometimes the index number can be different.</p>
  
  <p>Is there a way to remove them by matching the value name instead of the key value?</p>