title: Get the next array item using the key php
body: <p>I have an array </p>
  
  <pre><code>Array(1=&gt;'test',9=&gt;'test2',16=&gt;'test3'... and so on);
  </code></pre>
  
  <p>how do I get the next array item by passing the key.</p>
  
  <p>for example if i have key <code>9</code> then I should get <code>test3</code> as result. if i have <code>1</code> then it should return <code>'test2'</code> as result.</p>
  
  <p>Edited to make it More clear</p>
  
  <pre><code>echo  somefunction($array,9); //result should be 'test3'
  function somefunction($array,$key)
  {
    return $array[$dont know what to use];
  }
  </code></pre>