[] = mb_convert_encoding(,"UTF-8","gbk"); [] = 发现读取的中文字符串">
当前位置:Gxlcms > PHP教程 > fgetcsv函数不能读取csv文件中文字符串的解决方法_PHP教程

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

时间:2021-07-01 10:21:17 帮助过:4人阅读

读取数据函数:

     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...

人气教程排行