Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

append data in csv file php

<?php
$list = array
(
'Peter,Griffin,Oslo,Norway',
'Glenn,Quagmire,Oslo,Norway',
);

$file = fopen('contacts.csv','a');  // 'a' for append to file - created if doesn't exit

foreach ($list as $line)
  {
  fputcsv($file,explode(',',$line));
  }

fclose($file); 
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #append #data #csv #file #php
ADD COMMENT
Topic
Name
2+6 =