(PHP 5 >= 5.3.0, PHP 7)
str_getcsv — CSV 文字列をパースして配列に格納する
$input
[, string $delimiter = ","
[, string $enclosure = '"'
[, string $escape = "\\"
]]] ) : arrayCSV 形式の文字列入力のフィールドをパースして、 読み込んだフィールドの内容を配列で返します。
注意:
この関数はロケール設定を考慮します。もし LC_CTYPE が例えば en_US.UTF-8 の場合、 1 バイトエンコーディングの文字列は間違って読み込まれるかもしれません。
inputパースする文字列。
delimiterフィールド区切り文字 (1 文字のみ)。
enclosureフィールド囲み文字 (1 文字のみ)。
escapeエスケープ文字 (1 文字のみ)。デフォルトはバックスラッシュ (\)。
注意: Usually an
enclosurecharacter is escpaped inside a field by doubling it; however, theescapecharacter can be used as an alternative. So for the default parameter values "" and \" have the same meaning. Other than allowing to escape theenclosurecharacter theescapecharacter has no special meaning; it isn't even meant to escape itself.
読み込んだフィールドの内容を配列で返します。