$main_array=array('00','01','02');
$priority=array(0,0,0,0,0,0,0,0,1,2);
$rand_index=array_rand($priority);//select a random index from priority array.. $priority[$rand_index] will give you index 0 or 1 or 2 with your priority set..
echo $main_array[$priority[$rand_index]];
I think the code is self explanatory...
Array will have many elements case will come when lets say the requirement will come like 3% probability of "00" 28% prob. of "01" rest to other elements...In that case use array_fill function to fill elements in masses...and array_merge them
Like for the same case I've taken answer will be
$main_array=array('00','01','02');
$priority1=array_fill(0,69,2);
$priority2=array_fill(0,28,1);
$priority3=array_fill(0,3,0);
$priority=array_merge($priority1,$priority2,$priority3);
$rand_index=array_rand($priority);
echo $main_array[$priority[$rand_index]];