srand and array_rand don't work :(

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sKreeM
Forum Newbie
Posts: 4
Joined: Mon Aug 12, 2002 4:38 pm

srand and array_rand don't work :(

Post by sKreeM »

my code:


srand ((float) microtime() * 10000000);
return array_rand($lines,100);


The returned array is ALWAYS in the same order. I'm running PHP 4.2.3 and Apache/2.0.39

Does anyone have a solution or a workaround for this problem?
sKreeM
Forum Newbie
Posts: 4
Joined: Mon Aug 12, 2002 4:38 pm

Post by sKreeM »

when i upload this script to my webhost (lycos.co.uk) it works fine :(
Post Reply