Skip to content

Instantly share code, notes, and snippets.

@elishaukpong
Created May 2, 2022 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elishaukpong/03c8010c233ffc47c160c3a52400de26 to your computer and use it in GitHub Desktop.
Save elishaukpong/03c8010c233ffc47c160c3a52400de26 to your computer and use it in GitHub Desktop.
<?php
$numbers = [];
foreach(range(1,10) as $index){
$newAddition = mt_rand(1, 100000);
while(in_array($newAddition, $numbers)){
$newAddition = mt_rand(1, 100000);
}
$numbers[] = $newAddition;
}
dd($numbers);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment