yami007 Posted March 19, 2009 Share Posted March 19, 2009 this function generates a number with 10 charcters 1859219789 but i only wanna get 5 chars any help pelase Link to comment https://forums.phpfreaks.com/topic/150149-solved-mt_rand-function/ Share on other sites More sharing options...
rhodesa Posted March 19, 2009 Share Posted March 19, 2009 mt_rand(10000,99999); Link to comment https://forums.phpfreaks.com/topic/150149-solved-mt_rand-function/#findComment-788516 Share on other sites More sharing options...
yami007 Posted March 19, 2009 Author Share Posted March 19, 2009 thanks ^^ it's workiing for me but i want to know how it's working please Link to comment https://forums.phpfreaks.com/topic/150149-solved-mt_rand-function/#findComment-788519 Share on other sites More sharing options...
rhodesa Posted March 19, 2009 Share Posted March 19, 2009 Read the documentation on http://www.php.net/mt_rand Without arguments, it will return a random number between 0 and the highest possible integer. By providing the arguments 10000 and 99999, it will return a random number between those two values Link to comment https://forums.phpfreaks.com/topic/150149-solved-mt_rand-function/#findComment-788541 Share on other sites More sharing options...
Mark Baker Posted March 19, 2009 Share Posted March 19, 2009 but i want to know how it's working pleaseOr if you want to know how the Mersenne Twister algorithm works, the original paper by Makoto Matsumoto and Takuji Nishimura can be found here or summarised on wikipedia Link to comment https://forums.phpfreaks.com/topic/150149-solved-mt_rand-function/#findComment-788561 Share on other sites More sharing options...
yami007 Posted March 19, 2009 Author Share Posted March 19, 2009 rhodesa, mark barker thanks a lot Link to comment https://forums.phpfreaks.com/topic/150149-solved-mt_rand-function/#findComment-788569 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.