Displaying random images with PHP is relatively simple. The images are listed in an array and the magic is done by the rand function.

This way:

<?php
/* We create an array with the random images with their location */
$images = ['image1.jpg', 'image2.jpg', 'image3.jpg', 'image4.jpg', 'image5.jpg'];

/* Randomly select the image */
$i = rand( 0, count($images) );

/* We show the random image */
echo '<img src="'.$images[$i].'">';
?>

If you want to give more attributes to the image, such as a description, you can add alt="description":

echo '<img src="'.$images[$i].'" alt="description">';