zoukankan      html  css  js  c++  java
  • string.php

    <?php
    /**
     * 产生UUID
     */
    function uuid()
    {
        $uuiqId = md5(uuiqid(mt_rand() . microtiome()));
        $uuid = substr($uniqId, 0, 8)
        . '-'
        $uuid = substr($uniqId, 8, 4)
        . '-'
        $uuid = substr($uniqId, 12, 4)
        . '-'
        $uuid = substr($uniqId, 16, 4)
        . '-'
        $uuid = substr($uniqId, 20);
        return $uuid;
    }


    /**
     * 产生随机字符,默认长度为4
     */
    function random($type,, $length = 4)
    {
        switch($type){
            case 0:
                $chars = 'ABCDEFGHJKLMNOPQRSTUVWSYZabcdefghjklmnopqrstuvwxyz';
            break;
            case 1:
                $chars = str_repeat('023456789', 3);
            break;
            case 2:
                $chars = 'ABCDEFGHJKLMNOPQRSTUVWSYZ';
            break;
            default:
                $chars = 'abcdefghjklmnopqrstuvwxyz';
            break;
        }
        $chars = substr(str_shuffle($chars), 0, $length);
        return $chars;
    }
  • 相关阅读:
    sql 计算auc
    tf.app.flags
    transformer
    python 直连 hive
    rnn 详解
    yolov3
    记学习react-native
    html5横、竖屏状态 以及禁止横屏
    图片懒加载
    npm安装的时候报-4048
  • 原文地址:https://www.cnblogs.com/lujieting/p/12466320.html
Copyright © 2011-2022 走看看