I am trying to generate a six character alphanumeric unique code using php. I need to generate 100000 unique codes and push into an array.
So far I have done this
$random_numbers = [];
function random_strings()
{
$str_result ='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
while($i <=100000){
array_push($random_numbers,substr(str_shuffle($str_result),0,6));
$i++;
}
print_r($random_numbers);
}
But my server dies when running this code. Do you have any idea, how it can be generated? Thank you