douwudie8060 2011-08-19 13:41
浏览 40

通过FTP检索的文件编码不佳

When I get a CSV file, the header is bad. What impact the elements key

Exemple:

File format in FTP Server:

"store","id"
"admin","2"
"user","3"
....

Content Data geted from FTP Server by PHP

array(
    ['"store"'] => admin,
    ['id'] => 2
)
array(
    ['"store"'] => user,
    ['id'] => 3
)

Normally I have to have

['store'] and not ['"store"']

NB: That is for the first element only AND The encoding file is UTF-8

  • 写回答

1条回答 默认 最新

  • dongqiang2024 2011-08-19 13:49
    关注

    have a look at the documentation for getcsv() you need to pass the enclosure argument.

    评论

报告相同问题?