is there a way or function to populate an array using Regular expressions? e.g
$my_array = array([A-z]);
At the moment I have writen my own function to do it:
function makeAZ() {
$pool = "";
for($i = 48; $i <= 57; $i++) {
$pool .= chr($i);
// return($pool);
}
for($i = 65; $i <= 90; $i++) {
$pool .= chr($i);
// return($pool);
}
for($i = 97; $i <= 122; $i++) {
$pool .= chr($i);
// return($pool);
}
return($pool);
}
for($i=0;$i<=strlen(makeAZ()) - 1; $i++) {
$array1[] = substr(makeAZ(),$i,1);
}
for($i=0; $i<=20; $i++) {
mt_srand((double)microtime()*1000000);
$ranNum = mt_rand(0,count($array1) - 1);
$custID .= $array1[$ranNum];
}
Thanks