1 Star 3 Fork 0

Evan Wu/xmcsrv-api-php-signature

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
TimeMillisUtil.php 1000 Bytes
一键复制 编辑 原始数据 按行查看 历史
吴强强 提交于 5年前 . TimeMillisUtil
<?php
class TimeMillisUtil
{
private static $timMillis;
private static $counter = 1;
private static function getCounter()
{
self::$counter = self::$counter++;
if (self::$counter < 10) {
return "000000" . self::$counter;
} else if (self::$counter < 100) {
return '00000' . self::$counter;
} else if (self::$counter < 1000) {
return '0000' . self::$counter;
} else if (self::$counter < 10000) {
return '000' . self::$counter;
} else if (self::$counter < 100000) {
return '00' . self::$counter;
} else if (self::$counter < 1000000) {
return '0' . self::$counter;
} else if (self::$counter < 10000000) {
return self::$counter;
} else {
self::$counter = 1;
return '000000' . self::$counter;
}
}
public static function getTimMillis()
{
return self::getCounter() . time();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/wupz/xmcsrv-api-php-signature.git
git@gitee.com:wupz/xmcsrv-api-php-signature.git
wupz
xmcsrv-api-php-signature
xmcsrv-api-php-signature
master

搜索帮助