Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php append to csv

$handle = fopen("test.csv", "a");
fputcsv($handle, $line); # $line is an array of strings (array|string[])
fclose($handle);
Comment

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); 
?>
Comment

PREVIOUS NEXT
Code Example
Php :: what does defined di in php 
Php :: php currency formator 
Php :: laravel routes not working on production server 
Php :: time zone for php is not set (configuration parameter "date.timezone"). 
Php :: contact form 7 checkbox2 
Php :: update image in database using php 
Php :: php sort multidimensional array by key 
Php :: maintenance mode laravel 
Php :: laravel where in array 
Php :: composer create new laravel project 
Php :: php send json post 
Php :: check if post exists by id wordpress 
Php :: laravel migrations generator laravel 
Php :: post loop 
Php :: php if boolean check 
Php :: laravel mysql specified key was too long 
Php :: wp add menu page and subpage 
Php :: toggle between login and logout buttons php 
Php :: maatwebsite/excel package 5.2 laravel 
Php :: wordpress autosave 
Php :: laravel relationship search 
Php :: protected gaurded in laravel 
Php :: cut the first character in php 
Php :: php substr 
Php :: db seed in controller 
Php :: laravel eloquent bulk insert 
Php :: nginx codeigniter remove index.php 
Php :: Remove class from body tag in wordpress 
Php :: laravel eloquent get fillable 
Php :: continue in php 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =