This is a sample array from a csv file upload, which I'm working on
$csvData = array(7) {
[" Account Number"]=> string(32) " 1011001562781010"
[" Posting Date"]=> string(10) "07/08/2014"
[" Value Date"]=> string(10) "07/08/2014"
[" Description"]=> string(46) "Cash Withdrawal by Cheque173320--TT1421957901"
[" Debit Amount"]=> string(7) "2000.00"
[" Credit Amount"]=> string(0) ""
["Running Balance"]=> string(9) "388392.62"
}
While trying to fetch value using the $csvData ,I get the following error,
Notice: Undefined index: Account Number
This is my code:
foreach ($csvData as $csvRow) {
$csvData[$key] =$csvRow[$this->_csvColumnAccountNumber];
if (strtolower($csvRow[$this->_csvColumnAccountNumber]) === $csv_ied_account_number) {
$CsvValues[$key] = $csvRow[$this->_csvColumnCreditAmount];
$CsvValues[$key] = $csvRow[$this->_csvColumnDebitAmount];
}
}
I'm really stuck on this small issue. Please help me solve this as soon as possible.
Thanks in advance.