title: How do you reindex an array in PHP but with indexes starting from 1?
body: <p>I have the following array, which I would like to reindex so the keys are reversed (ideally starting at 1):</p>
  
  <p>Current array (<strong>edit:</strong> the array actually looks like this):</p>
  
  <pre><code>Array (
  
  [2] =&gt; Object
      (
          [title] =&gt; Section
          [linked] =&gt; 1
      )
  
  [1] =&gt; Object
      (
          [title] =&gt; Sub-Section
          [linked] =&gt; 1
      )
  
  [0] =&gt; Object
      (
          [title] =&gt; Sub-Sub-Section
          [linked] =&gt; 
      )
  
  )
  </code></pre>
  
  <p>How it should be:</p>
  
  <pre><code>Array (
  
  [1] =&gt; Object
      (
          [title] =&gt; Section
          [linked] =&gt; 1
      )
  
  [2] =&gt; Object
      (
          [title] =&gt; Sub-Section
          [linked] =&gt; 1
      )
  
  [3] =&gt; Object
      (
          [title] =&gt; Sub-Sub-Section
          [linked] =&gt; 
      )
  
  )
  </code></pre>