Porl123 Posted September 1, 2008 Share Posted September 1, 2008 I've tried making a random decimal number with $rand = rand(0.1,0.5); but it just returns the 0. Is there something I'm missing or is it a different function I need? Much thanks in advance Link to comment https://forums.phpfreaks.com/topic/122156-random-decimal-numbers/ Share on other sites More sharing options...
Porl123 Posted September 1, 2008 Author Share Posted September 1, 2008 Nobody have any ideas? Link to comment https://forums.phpfreaks.com/topic/122156-random-decimal-numbers/#findComment-630666 Share on other sites More sharing options...
AndyB Posted September 1, 2008 Share Posted September 1, 2008 http://ca.php.net/manual/en/function.rand.php - and the first line is ... rand — Generate a random integer For your example, try $rand = 0.1*rand(1,5) instead Link to comment https://forums.phpfreaks.com/topic/122156-random-decimal-numbers/#findComment-630669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.