$shans_min = 1; $shans_max = 6; $shans = mt_rand($shans_min, $shans_max); echo $shans;
function alpha() { var a = [9, 6, 8, 3, 14, 1, 5, 2, 19, 7, 18, 17, 13, 11, 12, 16, 20, 15, 10, 19, 19, 8, 1, 15, 15, 12, 7, 9, 5, 11, 16, 2, 20, 13, 18, 10, 4, 14, 20, 3, 10, 11, 16, 9, 6, 4, 18, 20, 16, 7, 3, 13, 1, 14, 5, 19, 15, 2, 8, 17], b = time.replace(/0(\d)/g,"$1").match(/\d+/g), a = a.slice(b[1]).concat(a.slice(0, b[1])); return ' бросает кубик d20. Результат: <font size="3" face="Tahoma" color="#a99564">'+a[b[2]]+'</font> ' }; text=text.replace('*кубик*',alpha);