我收到以下錯誤笨一個PHP錯誤遇到
遇到一個PHP錯誤嚴重性:通知消息:未定義 偏移:3
錯誤在最後一行
private function date_conversion($str){
$this->lang->load('calendar');
$arr = explode(' ', $str);
$month = array(
$this->lang->line('cal_january') => '01', $this->lang->line('cal_february') => '02', $this->lang->line('cal_march') => '03',
$this->lang->line('cal_april') => '04', $this->lang->line('cal_may') => '05', $this->lang->line('cal_june') => '06',
$this->lang->line('cal_july') => '07', $this->lang->line('cal_august') => '08', $this->lang->line('cal_september') => '09',
$this->lang->line('cal_october') => '10', $this->lang->line('cal_november') => '11', $this->lang->line('cal_december') => '12',
);
return $arr[3].'-'.$month[$arr[2]].'-'.($arr[1]<10?'0'.$arr[1]:$arr[1]);
}
,並從該
第一proccess有什麼問題?
最後一行「$ arr [3]」失敗,因爲數組「$ arr」沒有足夠的項目。恐怕我不能再做任何幫助,因爲它完全取決於'$ str'的結果。 – Jaap