我想在每次执行循环时将时间增加10毫秒。
$new_ts = "2015-07-01 14:16:31.000000";
for($i=0;$i<10;$i++){
echo $new_ts."<br>";
$ts = strtotime($new_ts);
$new_ts = date('Y-m-d H:i:s.u', $ts + 0.100000);
}
它生成类似
的输出2015-07-01 14:16:31.000000
2015-07-01 14:16:31.000000
2015-07-01 14:16:31.000000
2015-07-01 14:16:31.000000
2015-07-01 14:16:31.000000
2015-07-01 14:16:31.000000
2015-07-01 14:16:31.000000
2015-07-01 14:16:31.000000
2015-07-01 14:16:31.000000
2015-07-01 14:16:31.000000