$flag = 1; for ($i = 0; $i < 10; $i++) { $data['mobile'] = $evaluate_mobile; //随机时间 $second = rand($flag, 6 * ($i + 1));//重复10个1~60顺序且不重复的随机数 $flag = $second + 1;//加1是未免与上一结果重复 $data['second'] = $second; $result[] = $data; }