2015-06-15 33 views
0

創建pdf時可能會出現錯誤,我需要面對它。php修復16498行TCPDF的迷你錯誤:未定義索引:線程

PHP版本5.3

TCPDF版本6.2

if (($dom[$key]['value'] == 'table') AND (!TCPDF_STATIC::empty_string($dom[($dom[$key]['parent'])]['thead']))) 
    { 
     $dom[($dom[$key]['parent'])]['thead'] = str_replace(' nobr="true"', '', $dom[($dom[$key]['parent'])]['thead']); 
     $dom[($dom[$key]['parent'])]['thead'] .= '</tablehead>'; 
    } 

回答

0

這裏是一個只需要檢查數組元素中的溶液。

if (array_key_exists ('thead',$dom[($dom[$key]['parent'])])) 
{ 
        if (($dom[$key]['value'] == 'table') AND (!TCPDF_STATIC::empty_string($dom[($dom[$key]['parent'])]['thead']))) { 
        $dom[($dom[$key]['parent'])]['thead'] = str_replace(' nobr="true"', '', $dom[($dom[$key]['parent'])]['thead']); 
        $dom[($dom[$key]['parent'])]['thead'] .= '</tablehead>'; 
        } 
}