this is my code for to randomly echo images.
<?php
$imagesDir = "socimages/Badminton/";
$images = glob($imagesDir . '*.{jpg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
?>
<img src="<?php echo $randomImage[0]?>">
<img src="<?php echo $randomImage[1]?>">
It does not work if I specify each element in the array, so I was wondering how can I make it so that it will print random images but images cannot be the same, if I ignore the elements, it will print out the two images but the two images will be identical, if I reload the page, the image will change but both images will remain the same.