cloggedone Posted November 24, 2007 Share Posted November 24, 2007 I'm using: <?php $images = array("1.jpg","2.jpg","3.jpg"); srand(time()); for ($i=0;$i<3;++$i) echo "<img src='$images[$i]'>"; ?> but it displays all the images. I need it to display one every 10 seconds. Quote Link to comment https://forums.phpfreaks.com/topic/78705-image-display-with-1-displaying-every-10-seconds/ Share on other sites More sharing options...
toplay Posted November 24, 2007 Share Posted November 24, 2007 To display every 10 seconds something, you'll need to use JavaScript. Server code example for picking one out of 3: <?php $images = array("1.jpg","2.jpg","3.jpg"); $i = rand(0,2); echo "<img src='$images[$i]'>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/78705-image-display-with-1-displaying-every-10-seconds/#findComment-398296 Share on other sites More sharing options...
cloggedone Posted November 24, 2007 Author Share Posted November 24, 2007 I got the image loader ready, i just need the php backend. Quote Link to comment https://forums.phpfreaks.com/topic/78705-image-display-with-1-displaying-every-10-seconds/#findComment-398309 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.