otuatail Posted September 30, 2009 Share Posted September 30, 2009 Hi I realise that computers dont make good random number generators. I was wondering how I could make a random number using a seed as in. $seed = time(); $rnd = // $seed * 1 - 100 Desmond. Link to comment https://forums.phpfreaks.com/topic/176066-php-random-numbers/ Share on other sites More sharing options...
RussellReal Posted September 30, 2009 Share Posted September 30, 2009 srand Link to comment https://forums.phpfreaks.com/topic/176066-php-random-numbers/#findComment-927714 Share on other sites More sharing options...
otuatail Posted September 30, 2009 Author Share Posted September 30, 2009 The problem is this. Note: As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically. Does this mean I don't get a true random number as the seed is not used. What makes it truly random. No information on this. Link to comment https://forums.phpfreaks.com/topic/176066-php-random-numbers/#findComment-927727 Share on other sites More sharing options...
RussellReal Posted September 30, 2009 Share Posted September 30, 2009 that just says there is no need to seed it.. if you want to seed it you still can, however, you get a relatively random number already says php. Link to comment https://forums.phpfreaks.com/topic/176066-php-random-numbers/#findComment-927737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.