Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how can we merge csv file in laravel

<?php
function joinFiles(array $files, $result) {
    if(!is_array($files)) {
        throw new Exception('`$files` must be an array');
    }

    $wH = fopen($result, "w+");

    foreach($files as $file) {
        $fh = fopen($file, "r");
        while(!feof($fh)) {
            fwrite($wH, fgets($fh));
        }
        fclose($fh);
        unset($fh);
        fwrite($wH, "
"); //usually last line doesn't have a newline
    }
    fclose($wH);
    unset($wH);
}
Comment

PREVIOUS NEXT
Code Example
Php :: prevent cross site scripting php 
Php :: php update json file 
Php :: woocommerce remove notification after some time 
Php :: ipv6 pregmatch 
Php :: pcntl_fork php mysql "MySQL server has gone away" 
Php :: PHP str_pad — Pad a string to a certain length with another string 
Php :: prestashop category as homepage 
Php :: Call to undefined method :last() 
Php :: curl upload image huawei 
Php :: barryvdh laravel dompdf pages total 
Php :: how use same method in another class in laravel 
Php :: voirs les cles etrangeres phpmyadmin 
Php :: html css js php 
Php :: how to check if page is opened by bot 
Php :: laravel eloquent order by relationship 
Php :: themeHeader 
Php :: Laravel docker-compose 404 not found Nginx 
Php :: how to include pdf in php page 
Php :: php send POST request same folder 
Php :: php map array key to variable names 
Php :: folder name escape php 
Php :: php phalcon 
Php :: wpmu assign user to blog 
Php :: setup wp cron from external / cpanel cron service 
Php :: moodle admin cli 
Php :: overwrite existing key value pair php 
Php :: collection methods laravel 
Php :: php polymorphism 
Php :: what should write for getting extension of image in php 
Php :: how to host a php server 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =