我有一個數組,它是:PHP的strtotime奇怪的偏移誤差
array:2 [▼
0 => true
1 => "2015-08-26 08:42:51"
]
我可以訪問$arr[1] = "2015-08-26 08:42:51"
- 但是,如果我這樣做:strtotime($arr[1])
我得到:未定義抵消:1
什麼可能會導致這問題?在位置1設置的陣列..
編輯:
public static function in_date_range($needle, $date_from, $date_to)
{
$start_date = strtotime($needle[1]);
}
而且我把它從:
$date = $status['resource_completed'];
if(Helper::in_date_range($date,
strtotime($from_date"),
strtotime($to_dat)))
{
}
其中:
$date = array:2 [▼
0 => true
1 => "2015-08-26 08:42:51"
]
可否請你展示下這個現象發生的代碼? –
你所展示的對我來說工作得很好。向我們展示更多代碼 – Hearner
您確定您擁有一切正確的名字嗎?因爲它適合我。 – Smuuf