Helper/File.php
public function outputForceQuotesCSV($filepath, $csv)
    {
        $fqCsv = $this->arrayToCsv($csv, chr(9), '"', true, false);
        // Open for writing only; place the file pointer at the end of the file.
        // If the file does not exist, attempt to create it.
        $fp = fopen($filepath, 'a');

        // for some reason passing the preset delimiter/enclosure variables results in error
        // $this->delimiter $this->enclosure
        if (fwrite($fp, $fqCsv) == 0) {
            throw new \Exception('Problem writing CSV file');
        }
        fclose($fp);
    }
public function outputForceQuotesCSV($filepath, $csv)
    {
        $fqCsv = $this->arrayToCsv($csv, chr(9), '"', true, false);
        // Open for writing only; place the file pointer at the end of the file.
        // If the file does not exist, attempt to create it.
        $fp = fopen($filepath, 'a');

        // for some reason passing the preset delimiter/enclosure variables results in error
        // $this->delimiter $this->enclosure
        if (fwrite($fp, $fqCsv) == 0) {
            throw new \Exception('Problem writing CSV file');
        }
        fclose($fp);
    }
public function outputForceQuotesCSV ( $ filepath , $ csv ) { $ fqCsv = $ this -> arrayToCsv ( $ csv , chr ( 9 ) , '"' , true , false ) ; // Open for writing only; place the file pointer at the end of the file. // If the file does not exist, attempt to create it. $ fp = fopen ( $ filepath , 'a' ) ; // for some reason passing the preset delimiter/enclosure variables results in error // $this->delimiter $this->enclosure if ( fwrite ( $ fp , $ fqCsv ) == 0 ) { throw new \ Exception ( 'Problem writing CSV file' ) ; } fclose ( $ fp ) ; }
Output an array to the output file FORCING Quotes around all fields.

@param string $filepath
@param mixed $csv

@throws \Exception

@return null
Output an array to the output file FORCING Quotes around all fields .