I need php code to generate 10 digits alphanumeric value with first,third and fourth digit must be Capital alphabet and alphabet 'o' or 'O' should not be in generated code.
views:
22answers:
1
+2
A:
The following should provide you with the building blocks:
$letters = array_merge(range('A','N'),range('P','Z'));
$myRandom = $letters[(rand(1,count($letters))-1)];
$myRandom .= rand(0,9);
for($i = 3; $i <= 4; $i++) {
$myRandom .= $letters[(rand(1,count($letters))-1)];
}
for($i = 5; $i <= 10; $i++) {
$myRandom .= rand(0,9);
}
echo $myRandom;
Mark Baker
2010-07-20 11:30:43