rand
(PHP3 , PHP4)
rand ---&">nbsp; 产生乱数值
语法 : int rand( [int min] , [int max] );
说明 :
若无参数min与max,此函数传回的值会介于0和RAND_MAX之间。例如:您想让乱数值介于包含5和15之间,可使用rand(5,15)这种方式。在产生乱数值之前记得先使用srand()来设定乱数种子。
参考 : srand( ) getrandmax( ) mt_rand( ) mt_srand( ) mt_getrandmax( )
时间: 2024-09-05 19:25:42