Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我得到了这张照片中的 CSV 输出,它在数据之间插入了额外的空白行。可以修复吗?我试过修剪()。但它没有用。
尝试添加
if (!empty($td))
在每个 fputcsv() 调用之前。
TH 仅存在于第一次迭代中,而 TD 不存在于第一次迭代中,因此您可能会在每次迭代中添加空数据。