doujing1967 2014-02-14 20:38
浏览 147
已采纳

生成大随机数php [重复]

This question already has an answer here:

I want to generate a number with 75 characters using PHP.

I have searched everywhere and got nothing, except for this: http://dailycoding.com/tools/RandomNumber.aspx

I do not think it is effective to grab it from that page.

What I have tried is this:

rand(1,9999999999999999999999999999999999999);
</div>
  • 写回答

5条回答 默认 最新

  • duanfangbunao36970 2014-02-14 20:48
    关注

    try this

    function bigNumber() {
        # prevent the first number from being 0
        $output = rand(1,9);
    
        for($i=0; $i<74; $i++) {
            $output .= rand(0,9);
        }
    
        return $output;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?