PHP str_getcsv()Functions

PHP String 参考手册PHP String Reference Manual


Definition and Usage

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


Syntax

str_getcsv(string,separator,enclosure,escape)

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

Technical Details

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


PHP String 参考手册PHP String Reference Manual Other Extensions