TwistPHP Documentation

import

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

importPass 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.

Parameters

Name Type Description
$strLocalFilestringn/a
[$strLineDelimiter = "]stringn/a
[$intFieldDelimiter = ']integern/a
[$strEnclosure = '"']stringn/a
[$strEscape = ']stringn/a
[$blUseFirstRowAsKeys = false]booleann/a
[$strEncoding = 'UTF-8']stringn/a
[$strLocale = 'en_GB.UTF-8']stringn/a

Return Values

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

Example

<?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);