-
Notifications
You must be signed in to change notification settings - Fork 34
functions_modules_textdata
Initializes the textdata module This module provides functions for text-file processing
Definition: public function textdata_init()
Returns: void
Parses CSV data into an array. See http://www.php.net/manual/de/function.str-getcsv.php#95132
Definition: public function csv_to_array($csv, $delimiter=false, $enclosure, $escape, $callback=false)
Returns: array
An array with one entry per line, each beeing an array of fields
Parameters:
-
string $csv
CSV data as string -
string $delimiter
CSV delimiter used -
string $enclosure
CSV enclosure string -
string $escape
CSV escape string -
\Closure|string $callback
Function to be called for each detected row
Extracts the header from a CSV data string This is usually the first line which contains the field names.
Definition: public function csv_header($csv, $delimiter, $enclosure, $escape)
Returns: array
An array with one entry per field
Parameters:
-
string $csv
CSV data as string -
string $delimiter
CSV delimiter used -
string $enclosure
CSV enclosure string -
string $escape
CSV escape string
Tries to detect the CSV field delimiter This may be one of: ';' ',' '|' '\t'
Definition: public function csv_detect_delimiter($csv)
Returns: string
The delimiter that seems to match best
Parameters:
-
string $csv
CSV data as string
Removes the BOM header from a string.
Definition: public function remove_utf8_bom($text)
Returns: string
Clean string
Parameters:
-
string $text
Text, potentially with leading BOM