• PHP Video Tutorials

PHP - Function Str Getcsv



Syntax

array str_getcsv ( string $input [, string $delimiter = "," 
   [, string $enclosure = '"' [, string $escape = "\\" ]]] )

Definition and Usage

It is used to parse parse a CSV string into array

Return Values

It returns the indexed array.

Parameters

Sr.No Parameters & Description
1

input

It used to parse the input string

2

delimiter

It is used to set the field delimiter

3

enclosure

It is used to set the field enclosure character

4

escape

It is used to set the escape character

Example

Try out the following example

<?php
   $csv = array_map('str_getcsv', file('Str.csv'));
?>
php_function_reference.htm
Advertisements