TwistPHP Documentation

serve

File path: dist/twist/Core/Utilities/CSV.utility.php
Namespace: Twist\Core\Utilities
Extends: Base

serveCreate a CSV file and serve to the user, pass in a multi-dimensional array of data containing keys and values, the keys will be used as the field names and the values will be each for in the CSV. By default the Delimiter, Enclosure and Escape are already set.

Parameters

Name Type Description
$strFileNamestringn/a
$arrDataarrayn/a
[$strDelimiter = ']stringn/a
[$strEnclosure = '"']stringn/a

Return Values

void — No return information has been documented for this function.

Example

<?php
//Set the variables for the example
$strFileName 'foo';
$arrData = array(=> 'foo'=> 'bar');
$strDelimiter ';
$strEnclosure = '"';

//Call the function serve with the example vars
Twist::CSV() -> serve($strFileName$arrData$strDelimiter$strEnclosure);