mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 13:57:03 +08:00
109 lines
3.1 KiB
HTML
109 lines
3.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>解析 CSV 字符串为一个数组</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.str-getcsv" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">str_getcsv</h1>
|
|
<p class="verinfo">(PHP 5 >= 5.3.0, PHP 7)</p><p class="refpurpose"><span class="refname">str_getcsv</span> — <span class="dc-title">
|
|
解析 CSV 字符串为一个数组
|
|
</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.str-getcsv-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>str_getcsv</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$input</code></span>
|
|
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$delimiter</code><span class="initializer"> = ","</span></span>
|
|
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$enclosure</code><span class="initializer"> = '"'</span></span>
|
|
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$escape</code><span class="initializer"> = "\\"</span></span>
|
|
]]] ) : <span class="type">array</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
以 <acronym title="Comma Separated Value">CSV</acronym> 字段格式解析字符串输入,并返回包含读取字段的数组。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.str-getcsv-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">input</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
待解析的字符串。
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">delimiter</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
设定字段界定符(仅单个字符)。
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">enclosure</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
设定字段包裹字符(仅单个字符)。
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">escape</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
设置转义字符(仅单个字符)。默认为反斜线(<em>\</em>)。
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.str-getcsv-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
返回一个包含读取到的字段的索引数组。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.str-getcsv-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="fgetcsv.html" class="function" rel="rdfs-seeAlso">fgetcsv()</a> - 从文件指针中读入一行并解析 CSV 字段</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
</div></div></div></body></html> |