如何在PHP中生成随机的六位数数字 [英] How to generate random six digit numbers in PHP

查看:1223
本文介绍了如何在PHP中生成随机的六位数数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想生成六个数字.我将如何使用随机生成函数.

Hi, I want to generate six digit numbers.and how i will use random generate function is used.

推荐答案

天哪,怎么可能是个问题?

PHP具有带
Gosh, how can that be a problem?

PHP has the function rand with


min
min and


max参数的函数rand.您需要什么范围? 0到999999还是100000到999999?
就这样.

与提出问题相比,寻求帮助所需的时间更少.参见 http://php.net/manual/en/function.rand.php [ ^ ].

—SA
max parameter. What range do you need? 0 to 999999 or 100000 to 999999?
That''s all.

Looking at help would take less time than asking the question. See http://php.net/manual/en/function.rand.php[^].

—SA


这篇关于如何在PHP中生成随机的六位数数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆