I would like to know how I can get the script below to generate 300 sets of random characters.
This would avoid my having to press the reload button, 300 times.
Here is my script:
<?php
function GetID($x){
$characters = array("A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "2", "3", "4", "5", "6", "7", "8", "9");
shuffle($characters);
for (; strlen($ReqID)<$x;){
$ReqID .= $characters[mt_rand(0, count($characters))];
}
return $ReqID;
}
$ReqID .= GetID(5);
$ReqID .= "-";
$ReqID .= GetID(9);
$ReqID .= "-";
$ReqID .= GetID(5);
echo $ReqID;
$fh = fopen("300_file.txt","a+");
fwrite($fh, ("$ReqID")."\n");
fclose($fh);
?>
Plus, if there's a way to simplify the characters as an array, would be a bonus but not required.