I've got an excel file like this: Excel example
I want to read the columns F, G ,H ,J when I do:
for ($i = 3; $i <= $data->sheets[0]['numRows']; $i++) { error_log( FW_Class_Voucher_Code::cleanCode($data->sheets[0]['cells'][$i][6]).' - '. FW_Class_Voucher_Code::cleanCode($data->sheets[0]['cells'][$i][7]).' - '. FW_Class_Voucher_Code::cleanCode($data->sheets[0]['cells'][$i][8]).' - '. FW_Class_Voucher_Code::cleanCode($data->sheets[0]['cells'][$i][9])); $count++; }
I have the problem that I get errors:
PHP Notice: Undefined offset: 7 PHP Notice: Undefined offset: 8 PHP Notice: Undefined offset: 9
the F column is always full, but as you can see I've got problems with the others. How can I escape this error, so the field only gets checked if it's filled with data?
looks realy ugly but it works.