Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Rotating Images?

    Can Any One Tell Me Where Can i Find.. A Script...

    Like.. It Should From a List Of Image's Randomly Select Image and Display...

    Each Time I Refresh An The Page A Different Image Should Dispaly

  • #2
    New Coder
    Join Date
    Apr 2006
    Location
    UK
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    $image_array = array("filename1.jpg""filename2.jpg""filename3.jpg");

    $random_max count($image_array) - 1;
    $random_number rand(0$random_max);

    echo 
    "<img src=\""$image_array[$random_number]. "\"/>"

  • #3
    Regular Coder trib4lmaniac's Avatar
    Join Date
    Feb 2004
    Location
    Cornwall, UK
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by cdwhalley.com
    PHP Code:
    $image_array = array("filename1.jpg""filename2.jpg""filename3.jpg");

    $random_max count($image_array) - 1;
    $random_number rand(0$random_max);

    echo 
    "<img src=\""$image_array[$random_number]. "\"/>"
    PHP Code:
    $images= array("filename1.jpg""filename2.jpg""filename3.jpg");
    echo 
    '<img src="'$images[array_rand($images)]. '"/>'


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •