json配列の配列キーを整数にする必要があります。今、それらは文字列です。私の間違いはどこにあるのか教えていただけますか?
$i = 0;
while($i < 7) {
isset($ips[date('d', $week_start + $i * 86400)])
? $ips[(int)date('d', $week_start + $i * 86400)] = count(date('d', $week_start + $i * 86400))
: $ips[(int)date('d', $week_start + $i * 86400)] = 0;
isset($time[date('d', $week_start + $i * 86400)])
? $time[(int)date('d', $week_start + $i * 86400)] = count(date('d', $week_start + $i * 86400))
: $time[(int)date('d', $week_start + $i * 86400)] = 0;
$i++;
}
return json_encode(array('unique' => $time, 'impressions' => $ips));