gpt4 book ai didi

php - FGETCSV 文档缺陷

转载 作者:行者123 更新时间:2023-12-04 18:12:31 29 4
gpt4 key购买 nike

我一直试图弄清楚 length 是什么fgetcsv 中的参数意思是?该文档指出它是:

Must be greater than the longest line (in characters) to be found in the CSV file (allowing for trailing line-end characters). It became optional in PHP 5. Omitting this parameter (or setting it to 0 in PHP 5.0.4 and later) the maximum line length is not limited, which is slightly slower.



这并没有解释 length 的具体目的。资源。它只是提供有关要求的信息。

有人可以告诉我这是做什么的。谷歌没有帮助。我认为这是让我只读取 csv 文件第一行的关键,但我不确定。我尝试使用 1 的值对其进行测试但它仍然返回了一个完整的行数组。

最佳答案

这是您读取的每一行的长度限制,如果您将长度设置为 1000,则意味着您每行只能读取 1000 个字节的数据。

关于php - FGETCSV 文档缺陷,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12328515/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com