title: Insert "element" among other "elements" of the array (loop) php
body: <p>my code causes the images to appear randomly within the page.
  But how to insert an "element" (in my case would be a div) between these images?</p>
  
  <pre><code>&lt;?php
  $myImagesList = array (
      'image1.png',
      'image2.png',
      'image3.png',
      'image4.png'
  );
  
  shuffle ($myImagesList);
  for ($i=0; $i&lt;4; $i++) {
  
  echo '&lt;img src="/image/' . $myImagesList[$i] . '" width="200" height="140" border="0" /&gt;';
  }
  ?&gt;
  </code></pre>
  
  <p>Example:</p>
  
  <p><strong>The original code displays the images as follows:</strong></p>
  
  <p>image3.png image4.png image2.png image1.png</p>
  
  <p>F5 refresh page</p>
  
  <p>image2.png image1.png image4.png image3.png</p>
  
  <p>F5 refresh page</p>
  
  <p>image4.png image2.png image3.png image1.png</p>
  
  <p><br/></p>
  
  <p><strong>I needed it this way:</strong></p>
  
  <p>image2.png image1.png</p>
  
  <p> content </p>
  
  <p>image4.png image3.png</p>
  
  <p>F5 refresh page</p>
  
  <p>image4.png image2.png</p>
  
  <p> content </p>
  
  <p>image1.png image3.png</p>
  
  <p>F5 refresh page</p>
  
  <p>image2.png image3.png</p>
  
  <p> content </p>
  
  <p>image4.png image1.png</p>