fgetcsv - CSV File Not uploading data in codeigniter -


i can't upload data in csv starting letter 'c' , space

       c r mohan,3102,ii,d,,cin45l@yahoo.com,1234567890,        s r alex,3102,ii,d,,xuy566@yahoo.com,1234567880,   charmila,3102,ii,d,xu5566@yahoo.com,1234567880, 

the second , third line got inserted in db,but whenever line stating 'c' , space not inserting in db.pls help

use below function passing values in it

function escape_string($data) {     $result =   array();      if(is_array($data)){         foreach($data $row){             $utf_data =  mb_convert_encoding(str_replace('"', '',trim($row)), 'utf-8', 'utf-8');             $result[]   = str_ireplace('?', '', $utf_data);         }     }else{         //return utf8_encode(str_replace('"', '',trim($data)));         $utf_data =  mb_convert_encoding(str_replace('"', '',trim($data)), 'utf-8', 'utf-8');         return str_ireplace('?', '', $utf_data);     }     return $result; } 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -