title: PHP - Rearrange array by specific index
body: <p>For example I have the following code:</p>
  
  <pre><code>$sample = array(apple, orange, banana, grape);
  </code></pre>
  
  <p>I want to rearrange this array, by making <code>$sample[2]</code> the new <code>$sample[0]</code>, while keeping the same order throughout the array.</p>
  
  <p>Output should be:</p>
  
  <pre><code>Array ( [0] =&gt; banana [1] =&gt; grape [2] =&gt; apple [3] =&gt; orange) 
  </code></pre>