php自定义函数库

(1)获取随机数
function randCode($size = 6){
    $code = "";
    $str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
    for($i=0;$i<$size;$i++){
        $key = rand(0,62);
        $code.=substr($str,$key,1);
    }
    return $code;
}

分享文章:php自定义函数库
转载来于:http://azwzsj.com/article/ihcpco.html