首页 >函数列表 >str_getcsv

str_getcsv

str_getcsv

(PHP 5 >= 5.3.0)

str_getcsv 解析 CSV 字符串为一个数组

说明

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

fgetcsv() 类似,该函数解析一个输入字符串,而非像 fgetcsv() 那样以文件作为它的输入。

参数

input

待解析的字符串。

delimiter

设定字段界定符(仅单个字符)。

enclosure

设定字段包裹字符(仅单个字符)。

escape

设置转义字符(仅单个字符)。默认为反斜线()。

返回值

返回一个包含读取到的字段的索引数组。

参见

  • fgetcsv() - 从文件指针中读入一行并解析 CSV 字段

  • addcslashes
  • addslashes
  • bin2hex
  • chop
  • chr
  • chunk_split
  • convert_cyr_string
  • convert_uudecode
  • convert_uuencode
  • count_chars
  • crc32
  • crypt
  • echo
  • explode
  • fprintf
  • get_html_translation_table
  • hebrev
  • hebrevc
  • hex2bin
  • htmlentities
  • htmlspecialchars
  • htmlspecialchars_decode
  • html_entity_decode
  • implode
  • join
  • levenshtein
  • localeconv
  • ltrim
  • md5
  • md5_file
  • metaphone
  • money_format
  • nl2br
  • nl_langinfo
  • number_format
  • ord
  • parse_str
  • print
  • printf
  • quoted_printable_decode
  • quoted_printable_encode
  • quotemeta
  • rtrim
  • setlocale
  • sha1
  • sha1_file
  • similar_text
  • soundex
  • sprintf
  • sscanf
  • strcasecmp
  • strchr
  • strcmp
  • strcoll
  • strcspn
  • stripcslashes
  • stripos
  • stripslashes
  • strip_tags
  • stristr
  • strlen
  • strnatcasecmp
  • strnatcmp
  • strncasecmp
  • strncmp
  • strpbrk
  • strpos
  • strrchr
  • strrev
  • strripos
  • strrpos
  • strspn
  • strstr
  • strtok
  • strtolower
  • strtoupper
  • strtr
  • str_getcsv
  • str_ireplace
  • str_pad
  • str_repeat
  • str_replace
  • str_rot13
  • str_shuffle
  • str_split
  • str_word_count
  • substr
  • substr_compare
  • substr_count
  • substr_replace
  • trim
  • ucfirst
  • ucwords
  • vfprintf
  • vprintf
  • vsprintf
  • wordwrap
  • PHP MySQL HTML CSS JavaScript MSSQL AJAX .NET JSP Linux Mac ASP 服务器 SQL jQuery C# C++ java Android IOS oracle MongoDB SQLite wamp 交通频道