dachshund Posted June 27, 2009 Share Posted June 27, 2009 Hi, Does anyone know how to set up 2 images which each have a 50% chance of being shown? for example, when advertisements on sites change when you refresh the page. can this be done with php? thanks for any help. Quote Link to comment Share on other sites More sharing options...
.josh Posted June 27, 2009 Share Posted June 27, 2009 $array = array('image1.jpg','image2.jpg'); shuffle($array); echo "<img src='{$array[0]}' width = 'xx' height = 'xx' />"; Quote Link to comment Share on other sites More sharing options...
dachshund Posted June 27, 2009 Author Share Posted June 27, 2009 thanks! Quote Link to comment 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.