I have the follow code which are reading an CSV file using codeigniter by PHP:
//Upload to server:
$config['upload_path'] = './tmp/';
$config['allowed_types'] = 'gif|jpg|png|doc|txt|csv';
$config['max_size'] = 1024 * 8;
$config['encrypt_name'] = TRUE;
$csv_move_path = $this->config->item('directory')."/destination/";
$this->load->library('upload', $config);
$this->upload->do_upload('name_of_csv');
$this->upload->data();
move_uploaded_file($_FILES["file"]["tmp_name"], $csv_move_path . $_FILES["file"]["name"]);
$path = $csv_move_path . $_FILES["file"]["name"];
//Reading CSV
$fields; /** columns names retrieved after parsing */
$separator = ';'; /** separator used to explode each line */
$lines = file($path);
//Loop of lines
foreach( $lines as $line_num => $line )
{
if(!empty($line)){ // skip empty lines
$content = explode($separator, trim(str_replace('\'', '', $line)));
//Save line on DB
$this->model->addInformation($header_array,$content);
}}
My problem is when I have a very long numbers it automatically converts to scientific notation, so when I read in PHP it takes 3,53E+14, instead of 352564000000000, can someone help how can I read the entire number and not the scientific notation?
PS: I have already transform the field to text on CSV file, using Excel