"1.gif", "2.gif", "3.gif", "4.gif", "5.gif", "6.gif", "7.gif", "8.gif"); //Your Avatar filenames $url = 'http://yoururl.com/random/'; //Your or the site/dir they are located $avatar_number = rand(1,3); //Change 3 with the number of Avatars you have $rand_avatar = "$avatars[$avatar_number]"; header("Location: $url" . "$rand_avatar"); ?>