PHP str_getcsv() Function

The str_getcsv() function parses a string for fields in CSV format and returns an array containing the fields read.

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

Parses a string input for fields in CSV format and returns an array containing the fields read.

ParameterDescription
stringRequired. Specifies the string to parse
separatorOptional. A character that specifies the field separator. Default is comma ( , )
enclosure Optional. A character that specifies the field enclosure character. Default is "
escapeOptional. A character that specifies the escape character. Default is backslash (\)

Returns an indexed array containing the fields read.