// Seed the random srand ((double) microtime() * 10000000);...">

Random Pictures

I got a little piece of code written that will allow me to do random pictures.

// Seed the random
srand ((double) microtime() * 10000000);
// Open the text file and read in the full file
$fd = fopen ('images.txt', "r");
$text = fread($fd,filesize('images.txt'));
// Split the file at the \n into an array
$array = split ("\n", $text);
$filename = trim($array[array_rand($array,1)]);
// Close the file
fclose($fd);

So if you refresh this page you should get a random picture each time. This just means that I really need to take some more pictures. Some of the pictures that I put in there are only in there because I didn't have anything else to put in there. Maybe that's what I will do tomorrow. I just need to figure out what to take pictures of.
Leave A Reply - 1 Reply
Replies
sir **************** 2006-03-15 09:08am - No Email - Logged IP: 84.92.41.152

Yo my friend, Ur *** pics dont work!!!!!!!!!!!!!!!!!!!!!!

All content licensed under the Creative Commons License