Home  >  Q&A  >  body text

Ask for code, ask for code, ask for code!!

Generate a random number from 1 to 60, take out the duplicates and ask for the boss to appear. Generate a random number from 1 to 60, take out the duplicates and ask for the boss to appear!!

Generate a 1-60 Random numbers, take out the duplicates and ask for the boss to appear and generate a random number between 1 and 60. Take out the duplicates and ask for the boss to appear!!

Generate a random number between 1 and 60 and take out the duplicates. Please generate a random number from 1 to 60, and remove the duplicates. Please show up.

鹿先生鹿先生2018 days ago1455

reply all(6)I'll reply

  • 小灰

    小灰2019-03-19 17:37:11

    $a = [];

    for($i = 0;$i<60;$i++){

    $a[] = rand(1, 60);

    }

    $b = array_count_values($a);

    var_dump($b);

    //I don’t know what you want to do with duplicates What, but this way you can see how many times each one appears, and the ones >1 are all repeated, haha

    reply
    0
  • 从入门到删库跑路

    从入门到删库跑路2019-03-18 11:25:47

    I don’t understand this requirement

    reply
    0
  • 鹿先生

    Just generate 60 numbers randomly, there may be duplicates, and take out the duplicates.

    鹿先生 · 2019-03-18 11:27:13
  • 藏色散人

    藏色散人2019-03-15 17:19:07

    echo rand(1, 60);       

    // Generate a random number between 1000000~9999999

    reply
    0
  • 藏色散人

    is 1 to 60 ==

    藏色散人 · 2019-03-15 17:19:43
  • Cancelreply