Posted on 2006-09-28 10:39
my 阅读(613)
评论(0) 编辑 收藏 所属分类:
php5
#-------------------------------------------
# 获得最小和最大值之间随机数,位数不足补零
#-------------------------------------------
Function
getRandNumber
(
$fMin
,
$fMax
) {
srand
((double)
microtime
()*
1000000
);
$fLen
=
"%0"
.
strlen
(
$fMax
).
"d"
;
Return
sprintf
(
$fLen
,
rand
(
$fMin
,
$fMax
));
}