自己用php写的生成会员账号功能,仅供参考,代码如下:
CRMEB开源商城系统可免费商用,框架采用ThinkPHP6+MySQL+elementUI+uniapp,商城系统代码全部开源;前后台都支持风格切换,包含小程序商城、H5商城、公众号商城、App,支持多语言、分销、拼团、砍价、秒杀、优惠券、积分、抽奖、会员等级、小程序直播、页面DIY,前后端分离,方便二开,使用文档、接口文档、数据字典、代码生成、二开文档/视频教程。
1597
function get_number($table,$filed){
if(!isset($table) || !isset($filed)){
return '';
}
if(trim($table)=='' || trim($filed)==''){
return '';
}
global $db;
$user_number=str_shuffle(substr(randomname(-5),11));
$sql="select `id` from `".$table."` where `".$filed."`='".$user_number."'";
if($db->getRowsNum($sql) || strpos($user_number,'0')==0){
get_number($table,$filed);
}
return $user_number;
}
/***********生成随机数[随机数是后五位,一共是19位]****************/
function randomname($start,$len=''){
if(!isset($start) || !is_numeric($start) || ($len!='' && !is_numeric($len))){
return '';
}echo '-----';
$seedstr=explode(' ',microtime(),5);
$seed=$seedstr[0]*10000;
$random=date('YmdHis', time()).rand(10000,100000);
return $len===''?substr($random,$start):substr($random,$start,$len);
}
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号