mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-05-24 13:59:31 +08:00
modified 添加部分WEB功能
This commit is contained in:
parent
b49ac92882
commit
9238825e1b
@ -58,4 +58,50 @@ class StrRandom {
|
|||||||
return $ip = long2ip(mt_rand($ipLong[$randKey][0], $ipLong[$randKey][1]));
|
return $ip = long2ip(mt_rand($ipLong[$randKey][0], $ipLong[$randKey][1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机生成一个 URL 协议
|
||||||
|
* @return mixed
|
||||||
|
* @author zhaoxiang <zhaoxiang051405@gmail','com>
|
||||||
|
*/
|
||||||
|
public static function randomProtocol() {
|
||||||
|
$proArr = [
|
||||||
|
'http',
|
||||||
|
'ftp',
|
||||||
|
'gopher',
|
||||||
|
'mailto',
|
||||||
|
'mid',
|
||||||
|
'cid',
|
||||||
|
'news',
|
||||||
|
'nntp',
|
||||||
|
'prospero',
|
||||||
|
'telnet',
|
||||||
|
'rlogin',
|
||||||
|
'tn3270',
|
||||||
|
'wais'
|
||||||
|
];
|
||||||
|
shuffle($proArr);
|
||||||
|
|
||||||
|
return $proArr[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author zhaoxiang <zhaoxiang051405@gmail','com>
|
||||||
|
*/
|
||||||
|
public static function randomTld() {
|
||||||
|
$tldArr = [
|
||||||
|
'com', 'cn', 'xin', 'net', 'top', '在线',
|
||||||
|
'xyz', 'wang', 'shop', 'site', 'club', 'cc',
|
||||||
|
'fun', 'online', 'biz', 'red', 'link', 'ltd',
|
||||||
|
'mobi', 'info', 'org', 'edu', 'com.cn', 'net.cn',
|
||||||
|
'org.cn', 'gov.cn', 'name', 'vip', 'pro', 'work',
|
||||||
|
'tv', 'co', 'kim', 'group', 'tech', 'store', 'ren',
|
||||||
|
'ink', 'pub', 'live', 'wiki', 'design', '中文网',
|
||||||
|
'我爱你', '中国', '网址', '网店', '公司', '网络', '集团', 'app'
|
||||||
|
];
|
||||||
|
shuffle($tldArr);
|
||||||
|
|
||||||
|
return $tldArr[0];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user