title: troubles with unset to remove values from array
body: <p>I'm trying to remove values from an array using unset, but it's not working properly</p>
  
  <p>Say I have the following array</p>
  
  <pre><code>$array =
   [0]=&gt;a
   [1]=&gt;b
   [2]=&gt;c
  </code></pre>
  
  <p>These items are being displayed in a table with the ability to remove one. Say I press on the value for 'b'. A hidden value ($removeID in this case) is set, and when I echo it 'b' appears, so I know that value is being sent properly.</p>
  
  <p>Anyway, here is my code:</p>
  
  <pre><code>$removeID = $_POST['removeID']; //value to be removed. when echoe'd, it appears
  $key = array_search($removeID,$array); //finds the key of the value
  unset($array[$key]); 
  </code></pre>
  
  <p>Is there something I'm doing incorrectly? It will remove the largest key in the array every time.</p>
  
  <p><strong>edit- It appears as if the key isn't being properly found and is set to a boolean instead of  an integer</strong></p>
  
  <p>I tried gettype($key) and it displayed as boolean. When I echo $removeID it displays the value that I want to remove from the array, so why is it that it can't find it when using array_search? Can I not search for variables?</p>