我有这个数据:
SL-40551735,8 SL-40551734,8 75144,5 201761,0 10257,9 40173,97 853703,199
我希望它用file_put_contents函数写在.txt文件中。
问题是:在文件中,唯一写入的数据是:
75144,5 201761,0 10257,9 40173,97 853703,199
和
SL-40551735,8 SL-40551734,8
没有写。语法是:
file_put_contents("stock.txt", implode("\n", $csv));
你能帮我写所有数据吗?
答案 0 :(得分:0)
它正在运作:
<?php
$csv = ['SL-40551735,8', 'SL-40551734,8', '75144,5', '201761,0', '10257,9', '40173,97', '853703,199'];
file_put_contents("stock.txt", implode("\n", $csv));