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)
上一篇: WordPress判断用户是否登录的代码
下一篇: 关于计算加权的10篇文章推荐