<?php $nElementos = 20; 1 => 40, 2 => 30, 3 => 20, 4 => 10 ); if ($p < $posibilidades[$n]) $arr[] = $n; } ?>
Standard input is empty
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 2
[4] => 1
[5] => 3
[6] => 1
[7] => 3
[8] => 3
[9] => 1
[10] => 3
[11] => 1
[12] => 1
[13] => 1
[14] => 2
[15] => 4
[16] => 1
[17] => 3
[18] => 1
[19] => 1
)