Instead of the IF construction, you probably want a SWITCH:
switch(rand(1,$theodds)) {
case 1:
echo 'you got case 1';
break;
case 2:
echo 'you got case 2';
break;
//etc.
default:
echo 'you didn't get any of the specified cases';
}
don't forget to add 'break;' after each case
Ignore malicious posters.