Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP str_getcsv() Function

PHP str_getcsv() Function

PHP String Reference Manual PHP String Reference Manual


Definition and Usage

The str_getcsv() function parses a string of CSV-formatted fields and returns an array containing the read fields.


Syntax

str_getcsv(

string,separator,enclosure,escape

)

Parameters Description
string Required. Specifies the string to parse.
separator Optional. Sets the field delimiter (only one character allowed). Default is a comma ( , ).
*enclosure * Optional. Sets the field enclosure (only one character allowed). Default is a double quote ( " ).
escape Optional. Sets the escape character (only one character allowed); the default value is a backslash ( \ ).

Technical Details

Return Value: Returns the CSV fields as an array.
PHP Version: 5.3.0+

PHP String Reference Manual PHP String Reference Manual