This commit is contained in:
wangjinlei
2022-10-17 18:14:27 +08:00
parent e4bc0f5906
commit 12a00f583c
6 changed files with 134 additions and 52 deletions

View File

@@ -112,6 +112,20 @@ function object_to_array($obj) {
return $obj;
}
function get_str(){
$length = 32;
$str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$len = strlen($str)-1;
$randstr = '';
for ($i=0;$i<$length;$i++) {
$num=mt_rand(0,$len);
$randstr .= $str[$num];
}
return md5($randstr.time());
}
/**
* 生成文章sn号
* @return type