請告訴我最快的方式上傳到PHP的CSV,同時刪除重複(電話號碼)。PHP上傳CSV刪除重複
例子:
Kyle,Hudson,447000000000,[email protected],CUST-1,CUST-2,CUST-3
John,Doe,447000000001,[email protected],CUST-1,CUST-2,CUST-3
John,Doe,447000000001,[email protected],CUST-1,CUST-2,CUST-3
Jack,Doe,447000000004,[email protected],CUST-1,CUST-2,CUST-3
應該改爲:
Kyle,Hudson,447000000000,[email protected],CUST-1,CUST-2,CUST-3
John,Doe,447000000001,[email protected],CUST-1,CUST-2,CUST-3
Jack,Doe,447000000004,[email protected],CUST-1,CUST-2,CUST-3
我知道如何上傳CSV ECT,我只需要知道如何刪除重複。
我需要創建一個數組或類似的東西,然後用像array_unique功能?
你的幫助是appriciated :)
戈,什麼是一個CSV文件轉換成數組的最佳方式? – 2011-03-22 16:06:52
那麼,有:http://php.net/manual/en/function.fgetcsv.php 但是,恕我直言,你最好讓自己的東西。 於是打開與file_get_contents()函數的文件,然後爆炸()爲「\ n」,你現在必須每行的數組。然後再次爆炸,這次使用逗號,分號或任何分隔符。現在你有新的數組中的每個項目。 – 2011-03-22 16:09:03