title: php arrays next() and prev()
body: <p>I have an array that looks like this,</p>
  
  <pre><code>    Array
  (
      [0] =&gt; 849710414
      [1] =&gt; 849710726
      [2] =&gt; 849710744
      [3] =&gt; 849712728
      [4] =&gt; 849713005
      [5] =&gt; 849713439
      [6] =&gt; 849714856
      [7] =&gt; 849714924
      [8] =&gt; 849716371
      [9] =&gt; 849716441
      [10] =&gt; 849717118
      [11] =&gt; 849719043
      [12] =&gt; 849719187
      [13] =&gt; 849722865
      [14] =&gt; 849723412
      [15] =&gt; 849723777
      [16] =&gt; 849725052
      [17] =&gt; 849726294
      [18] =&gt; 849726457
      [19] =&gt; 849726902
      [20] =&gt; 849728239
      [21] =&gt; 849728372
      [22] =&gt; 849728449
      [23] =&gt; 849730353
      [24] =&gt; 849733625
  )
  </code></pre>
  
  <p>These are ID's that I need to add to an URL to navigate around the site, the IDs are the results that get returned from a user's search, the user then clicks on a search result and has the option of going to the next search result are look at the previous one, now I though I would be able to do this, by doing </p>
  
  <pre><code>&lt;a href="&lt;?=next($array);?&gt;"&gt;Next&lt;/a&gt;
  &lt;a href="&lt;?=prev($array);?&gt;"&gt;Prev&lt;/a&gt;
  </code></pre>
  
  <p>How ever I does not seem to recognise what the current result ID I am looking at is to work what is next and previous? Does anybody now how I can solve this?</p>