title: PHP splitting array into two arrays based on value
body: <p>I have a PHP array that I am trying to split into 2 different arrays.  I am trying to pull out any values that contain the word "hidden".  So one array would contain all the values that do not contain the word "hidden".  The other array would contain all the values that do contain the word "hidden".  I just can't figure out how to  do it though.</p>
  
  <p>The original array is coming from a form post that contains keys and values from a bunch of check boxes and hidden inputs.  so the actual post value looks something like this:</p>
  
  <pre><code>Group1 =&gt; Array([0] =&gt; item1,[1] =&gt; item2hidden,[2] =&gt; item3,[3] =&gt; item4,[4] =&gt; item5hidden)
  </code></pre>
  
  <p>so to simplify it:</p>
  
  <pre><code>$myArray = Array(item1, item2hidden, item3, item4, item5hidden)
  </code></pre>
  
  <p>final output</p>
  
  <pre><code>$arr1 = (item1, item3, item4)
  $arr2 = (item2hidden, item5hidden)
  </code></pre>
  
  <p>Anyone know how to do something like this?</p>