Advertisement
Guest User

Untitled

a guest
Oct 29th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2.  
  3. $updateFinal = array(
  4. array(
  5. 'sku' => 14110,
  6. 'price' => 35,
  7. 'fulfillment-channel' => 'amazon'
  8. ),
  9.  
  10. array(
  11. 'sku' => 14486,
  12. 'price' => 48.16,
  13. 'fulfillment-channel' => 'amazon'
  14. ),
  15.  
  16. array(
  17. 'sku' => 14430,
  18. 'price' => 46,
  19. 'fulfillment-channel' => 'amazon'
  20. ),
  21.  
  22. array(
  23. 'sku' => 15124,
  24. 'price' => 25.8,
  25. 'fulfillment-channel' => 'amazon'
  26. ),
  27. );
  28.  
  29. $handle = fopen("prices.txt", 'w+');
  30. $keys = array_keys($updateFinal[0]);
  31. fputcsv($handle,$keys,"\t");
  32. foreach ($updateFinal as $row) {
  33. fputcsv($handle, $row, "\t");
  34. }
  35. fclose($handle);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement