用于获取JS一定范围的随机整数(自己想出来的,不喜勿喷) function getRand($min, $max) { var rand = Math.random(); return Math.round($min + rand*($max - $min)); }