php already has an [man]array_rand[/man] function.... use it with rand() (basically weepackts suggestion)
it has some overhead (you are creating an array with range() just to pull numbers out :eek: )
<?php
/// gets 6 random items from an array: gets us 6 non-overlapping numbers from 0 through 65
$randoms_items = array_rand(range(0,65),6);
// joins 6 non-overlapping digits from 0 to 65 into one string
$random_string = join(array_rand(range(0,65),6),'');
// show our results
print "<pre>";
print_r($random_string);
print "\n";
print_r($randoms_items);
print "</pre>";
?>
also id like to point out for efficiency:
while(count($BookSelectNumber)<6 && !in_array($s=rand(0,65),$BookSelectNumber))
calling count() and in_array() each iteration is expensive.....
assuming that you never have a collision while asking for 6 items this will loop through ~7 items each iteration (42 total)... adding another ~5 items to loop through on each collision...
this is kinda expensive... for just getting 6 numbers