Codeigniter CSV file undefined index |
I'm trying to display the content of CSV file, using Codeigniter.
I used a library CSVReader (found here https://github.com/alemohamad/ci-csv-rea...Reader.php) I got this error message : A PHP Error was encountered Severity: Notice Message: Undefined index: head2 Here is my code. Please tell me what is wrong. Thanks -- File contents head1;head2 EBBST02;col EBBST08;lad EBBST12;vad EBBST1;saz EBBST19;xed EBBSS28;red --Controller Code: public function import(){ --View Code: <!-- Data list table -->
You are using ; as an separator. That script are based on ,.
https://github.com/alemohamad/ci-csv-rea...er.php#L14 (05-30-2020, 05:29 AM)jreklund Wrote: You are using ; as an separator. That script are based on ,. Many Thanks!!! You saved my day. I changed the separator in CSVReader Below is the final code. Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
Welcome Guest, Not a member yet? Register Sign In |