update : 2015.11.03
php.shukuma.com

검색:
 
 
Parse a CSV string into an array

str_getcsv

(PHP 5 >= 5.3.0)

str_getcsv Parse a CSV string into an array

설명

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.

인수

input

The string to parse.

delimiter

Set the field delimiter (one character only).

enclosure

Set the field enclosure character (one character only).

escape

Set the escape character (one character only). Defaults as a backslash (\)

반환값

Returns an indexed array containing the fields read.

참고

  • fgetcsv() - Gets line from file pointer and parse for CSV fields