title: PHP - fast way to get previous array elements before specific key
body: <p>How can I get all previous element before a specific array key. </p>
  
  <p>Here is my array:</p>
  
  <pre><code>$key = 256;
  
  $array = (
  125 =&gt; array(571, 570), 
  284 =&gt; array(567, 566),
  256 =&gt; array(562, 560),
  110 =&gt; array(565, 563),
  );
  </code></pre>
  
  <p>Now I want result like this:</p>
  
  <pre><code>$array = (
  125 =&gt; array(571, 570), 
  284 =&gt; array(567, 566)
  );
  </code></pre>