简体   繁体   中英

How to use php to generate random 10 digit number that begins with the same two digits

我正在为我的学校项目开发银行和投资网站/系统,请有人帮我编写一个 PHP 代码,该代码在用户注册时生成一个随机的 10 位帐号,但帐号都必须以相同的两个开头-像01这样的数字,谢谢

maybe something like this

$fixed = '01';
$number = $fixed.mt_rand( 10000000, 99999999);
echo $number;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM