我正在为 jQuery 使用 flot 图形库,它对任何时间序列都使用 javascript 时间(提醒一下,这是自 1970 年 1 月以来的毫秒数。Unix 时间是seconds)。
我当前的代码如下所示:
foreach($decoded['results'] as $currentResult) {
if($currentResult['from_user'] == $user) {
$strippedTexts = $currentResult['created_at'];
$dates []= strtotime($strippedTexts);
}
}
这给了我一组 Unix 时间戳。我想在循环中为 JavaScript 准备数据,但是当我尝试
$dates []= 1000*strtotime($strippedTexts);
数字太大,它会吐出“[-2147483648]”。我是否需要将允许在数组中保存的变量的“类型”更改为 bignum 之类的?
谢谢!