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 :: laravel find by 
Php :: laravel request integer 
Php :: how to separate integer from string in php 
Php :: laravel api form request validation 404 
Php :: run a server php terminal 
Php :: str_replace php 
Php :: change returning datetime timezone to recalculate with user timezone laravel 
Php :: how to get last executed query in laravel 
Php :: calculate sum (total) of column in php 
Php :: php enter line break 
Php :: carbon difference between two dates 
Php :: convert multi-dimensional array into a single array in php 
Php :: how to backup laravel project 
Php :: php array merge skip diplicate 
Php :: date and time in php 
Php :: php start of day epoch 
Php :: force delete soft delete laravel 
Php :: deactivate auto update wordpress plugins 
Php :: minus day from carbon date 
Php :: laravel create seeder 
Php :: Deleting an element from an array in PHP 
Php :: laravel websockets onsubscribe 
Php :: the posts pagination 
Php :: send value from one page to another in php 
Php :: lcomposer symfony/filesystem 
Php :: --prefer-dist what is use in laravel 
Php :: laravel query latest 
Php :: validation not exist in table laravel 
Php :: image storage storepublicy in laravel 
Php :: use php variable in html attributes 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =