rand是一個函式,它返回一個大於或等於 0 且小於EXPRESSION值的隨機分數。沒有EXPRESSION,則使用1值,以便隨機數的區間為 [ 0 , 1 ) {\displaystyle [0,1)} .
rand EXPRESSION rand
$a = rand(31); print 'int(' . "$a" . ') = ', int($a);
int(28.7540893554688) = 28