title: Shift an entire array to the by one position in php
body: <p>For example:  I have an array that looks like this: <code>Array ( [0] =&gt; A [1] =&gt; B [2] =&gt; C [3] =&gt; D [4] =&gt; E [5] =&gt; F).</code> and etc..</p>
  
  <p>I want to push the entire array by 1 to the right, so it looks like this: <code>( [0] =&gt; 0 [1] =&gt; A [2] =&gt; B [3] =&gt; C [4] =&gt; D [5] =&gt; E [6] =&gt; F).</code> and etc....</p>
  
  <p>Edit: My bad. I didn't word my question properly. I'm hoping I don't confuse people trying to clarify.  I'd like to continue to push the array until the end of the array length.  For example $len is 7.  I'd like to perform an action on the array before iterating to the next position.   So it looks like this:</p>
  
  <pre><code>Array ( [0] =&gt; 0 [1] =&gt; 0 [2] =&gt; 0 [3] =&gt; 0 [4] =&gt; 0 [5] =&gt; 0 [6] =&gt; A).
  </code></pre>
  
  <p>My first attempt at this problem was to create a for loop:  </p>
  
  <pre><code>for ($i = 0; $i &lt; $len; $i++) {
    echo $chars[$i + 1];
    array_unshift($chars, 0);
  }
  </code></pre>
  
  <p>My loop gives me 7 B's, which isn't what I want. </p>
  
  <p>Is what I'm describing possible?</p>