Jump to content

Random Image not working


backinblack

Recommended Posts

I have a code that does a random image every time they come to the site but for some reason it is not working. I must be missing something. Can some one help me out?

<?php
$images = array('pic1', 'pic2', 'pic3');
$i = rand(0, count($images)-1);
$selectedImage = "images/{$images[$i]}.jpg";
?>

Link to comment
https://forums.phpfreaks.com/topic/144384-random-image-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.