RT
例如543535353453454345345345345345345345345345345345435 这么长的整数!

解决方案 »

  1.   

    $rand=rand(1000000000000000000000000000000000000000000000000,999999999999999999999999999999999999999);
    产生一随机数,第一个参数是前范围即要大于前一个参数,第二个参数是后范围!
      

  2.   

    echo getKey(5);
    echo "<br/>";
    echo getKey(10);
    echo "<br/>";
    echo getKey(20);
    echo "<br/>";
    echo getKey(40);
    echo "<br/>";function getKey($length){
    $pattern = "1234567890";
    $key = "";
    for($i=0;$i<$length;$i++)$key.=$pattern{rand(0,9)};
    return $key;
    }
      

  3.   

    function getInt($length)
    {
      for($i=0;$i<$length;$i++)
      {
        $key .= rand(0,9);
      }
      return $key;
    }echo(getInt(15));