I'm a bit of a noob in PHP and I'm learning it right now. I'm making a website that displays 2 random pictures side by side. However at the moment with my current code, it means on some occasions you may get the same picture loaded twice. Here is my code:
<img src="images/
<?php
$pics = array('image1.jpg', 'image2.jpg', 'image3.jpg', 'image4.jpg');
echo $pics[array_rand($pics)];
?> " />
<img src="images/
<?php
$pics = array('image1.jpg', 'image2.jpg', 'image3.jpg', 'image4.jpg');
echo $pics[array_rand($pics)];
?> " />