I have this code which display random images from any folder on a webserver. You just have to give each picture the same name but with a number at the end of it (make foo.bar foo1.bar footype.bar foo2.bar).
Does anybody have any idea how to make this work accept not have any numbers or have the same name on the pictues. I just want it to display any picture in that folder in the webserver regardless of the name. Here is the code.
<?php
function image()
{
$min = 1; //The first number one of your images has
$max = 3; //The highest number you image has
$number = rand($min, $max);
$url = "http://website.com/~ub/_ubr/wp-content/themes/ubcmi/images/icons/image" . $number . ".jpg"; //change the url to your url //for the image split the url into two parts by separating in between the image name and //extension
echo "<img src='$url'>";
}
?>