欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

fgetcsv函数不能读取csv文件中文字符串的解决方法_PHP教程

程序员文章站 2022-04-19 21:04:03
...
读取数据函数:
     getData( = (( = (,"r")) !== (( = ()) !==  = (  =>[] = mb_convert_encoding(,"UTF-8","gbk");  [] =  

发现读取的中文字符串为空....

解决方法:将fgetcsv函数换成自定义的_fgetcsv函数

     _fgetcsv(&,  = ,  = ',',  = '"' = ( = ( = ""= ( !=  .= ( () ? () : (,  = ('/' .  . '/', ,  ( % 2 == 0 =  = ('/(?: |[ ])?$/', , ( = '/(' .  . '[^' .  . ']*(?:' .  .  . '[^' .  . ']*)*' .  . '|[^' .  . ']*)' .  . '/'(, ,  = [1 ( = 0;  (); ++[] = ('/^' .  . '(.*)' .  . '$/s', '$1' , [[] = ( . , , [  () ?  : 

参考:

http://bbs.csdn.net/topics/390040230

http://hi.baidu.com/maojianlw/item/d3ee390e820cfbcb75cd3c5c

http://phpexcel.codeplex.com/(操作excel的库:phpexcel)

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/756407.htmlTechArticle读取数据函数: getData( = (( = ( ,"r")) !== (( = ( )) !== = ( = [] = mb_convert_encoding( ,"UTF-8","gbk"); [] = 发现读取的中文字符串为空.... 解决方法:将fg...
相关标签: aspnet 软件编程