当前位置:网站首页>Generate random 6-bit invitation code in PHP
Generate random 6-bit invitation code in PHP
2022-07-02 07:28:00 【Snow wind in the night sky】
Preface
In the process of system development, it is sometimes necessary to enter the invitation code when the user registers , Here is a way to quickly generate invitation codes .
/** * Generate invitation code * @param unitCode */
function create_invite_code($unitCode, $len = 3)
{
$arr = ["1", "2", "3", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
$arrLen = count($arr) - 1;
for ($i = 0; $i < $len; $i++) {
$unitCode .= $arr[mt_rand(0, $arrLen)];
}
return $unitCode;
}
for example :ANC39K
边栏推荐
- Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'
- Module not found: Error: Can't resolve './$$_ gendir/app/app. module. ngfactory'
- Optimization method: meaning of common mathematical symbols
- Explanation of suffix of Oracle EBS standard table
- ssm人事管理系统
- Alpha Beta Pruning in Adversarial Search
- view的绘制机制(二)
- 生成模型与判别模型的区别与理解
- 腾讯机试题
- 一个中年程序员学习中国近代史的小结
猜你喜欢

Pratique et réflexion sur l'entrepôt de données hors ligne et le développement Bi

ssm超市订单管理系统

Oracle EBS ADI development steps

Only the background of famous universities and factories can programmers have a way out? Netizen: two, big factory background is OK

SSM personnel management system
![[introduction to information retrieval] Chapter 3 fault tolerant retrieval](/img/75/ac2fdcd256f5c2336ca53c7a2744b8.png)
[introduction to information retrieval] Chapter 3 fault tolerant retrieval

Point cloud data understanding (step 3 of pointnet Implementation)

【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization

TCP attack

ORACLE EBS中消息队列fnd_msg_pub、fnd_message在PL/SQL中的应用
随机推荐
Transform the tree structure into array in PHP (flatten the tree structure and keep the sorting of upper and lower levels)
The first quickapp demo
Three principles of architecture design
第一个快应用(quickapp)demo
@Transitional step pit
Oracle EBS ADI development steps
读《敏捷整洁之道:回归本源》后感
Oracle 11g uses ords+pljson to implement JSON_ Table effect
SSM学生成绩信息管理系统
How to efficiently develop a wechat applet
ARP attack
Pratique et réflexion sur l'entrepôt de données hors ligne et le développement Bi
Using MATLAB to realize: power method, inverse power method (origin displacement)
ssm超市订单管理系统
ERNIE1.0 与 ERNIE2.0 论文解读
ssm人事管理系统
Oracle 11.2.0.3 handles the problem of continuous growth of sysaux table space without downtime
Message queue fnd in Oracle EBS_ msg_ pub、fnd_ Application of message in pl/sql
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'
Delete the contents under the specified folder in PHP