title: How can I loop through the entire array starting from any position?
body: <p>So I have an array like this:</p>
  
  <pre><code>$arr = [0, 1, 2];
  </code></pre>
  
  <p>Now I get a user input, e.g.</p>
  
  <pre><code>$input = 1;
  </code></pre>
  
  <p>Depending on that input I want to loop through all array elements starting from the position of that input.</p>
  
  <p>Example:</p>
  
  <pre><code>//Array: [0, 1, 2]
  Input: 0 Output: 012
  Input: 1 Output: 120
  Input: 2 Output: 201
  </code></pre>
  
  <p>I don't know much about PHP so I tried a simple for loop:</p>
  
  <pre><code>for($x = 1; $x &lt;= 2; $x++)
  {
      echo $x;
  }
  </code></pre>
  
  <p>But obviously this doesn't work, so I'm stuck from where I have to go from here.</p>