Skip to content

Instantly share code, notes, and snippets.

@egin10
Created January 10, 2020 12:44
Show Gist options
  • Save egin10/06db0d1b34bf1f602e19abcd6b8a18fb to your computer and use it in GitHub Desktop.
Save egin10/06db0d1b34bf1f602e19abcd6b8a18fb to your computer and use it in GitHub Desktop.
Random Example Transaction Code
$arr = [];
for($i = 0; $i < 10; $i++) {
$num_rand = num_rand();
if(!in_array($num_rand, $arr)) {
$arr[] = $num_rand;
}else{
$num_rand = num_rand();
$arr[] = $num_rand;
}
}
function num_rand() {
$num_rand = rand();
$str_num_rand = substr((string)$num_rand,0,6)."MC";
return $str_num_rand;
}
print_r($arr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment