File path: dist/twist/Core/Utilities/CSV.utility.php
Namespace: Twist\Core\Utilities
Extends: Base
import
— Pass in the local file path to a CSV file, the CSV file will be parsed and turned into an array. By default the Delimiter, Enclosure and Escape are already set.
Name | Description |
---|---|
$strLocalFile | n/a |
[$strLineDelimiter = "] | n/a |
[$intFieldDelimiter = '] | n/a |
[$strEnclosure = '"'] | n/a |
[$strEscape = '] | n/a |
[$blUseFirstRowAsKeys = false] | n/a |
[$strEncoding = 'UTF-8'] | n/a |
[$strLocale = 'en_GB.UTF-8'] | n/a |
void — No return information has been documented for this function.
<?php
//Set the variables for the example
$strLocalFile = 'foo';
$strLineDelimiter = ";
$intFieldDelimiter = ';
$strEnclosure = '"';
$strEscape = ';
$blUseFirstRowAsKeys = false;
$strEncoding = 'UTF-8';
$strLocale = 'en_GB.UTF-8';
//Call the function import with the example vars
Twist::CSV() -> import($strLocalFile, $strLineDelimiter, $intFieldDelimiter, $strEnclosure, $strEscape, $blUseFirstRowAsKeys, $strEncoding, $strLocale);