public static function download_array($filename, array &$records, $delimiter = 'comma', $enclosure='"') {
        $csvdata = new csv_export_writer($delimiter, $enclosure);
        $csvdata->set_filename($filename);
        foreach ($records as $row) {
            $csvdata->add_data($row);
        }
        $csvdata->download_file();
    }
public static function download_array($filename, array &$records, $delimiter = 'comma', $enclosure='"') {
        $csvdata = new csv_export_writer($delimiter, $enclosure);
        $csvdata->set_filename($filename);
        foreach ($records as $row) {
            $csvdata->add_data($row);
        }
        $csvdata->download_file();
    }
public static function download_array ( $ filename , array & $ records , $ delimiter = 'comma' , $ enclosure = '"' ) { $ csvdata = new csv_export_writer ( $ delimiter , $ enclosure ) ; $ csvdata -> set_filename ( $ filename ) ; foreach ( $ records as $ row ) { $ csvdata -> add_data ( $ row ) ; } $ csvdata -> download_file ( ) ; }
Creates a file for downloading an array into a deliminated format.
This function is useful if you are happy with the defaults and all of your
information is in one array.

@param string $filename    The filename of the file being created.
@param array $records      An array of information to be converted.
@param string $delimiter   The name of the delimiter. Supported types(comma, tab, semicolon, colon, cfg)
@param string $enclosure   How speical fields are enclosed.
Creates a file for downloading an array into a deliminated format . This function is useful if you are happy with the defaults and all of your information is in one array .