mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
134 lines
4.6 KiB
HTML
134 lines
4.6 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>Parse RFC 822 compliant addresses</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.mailparse-rfc822-parse-addresses" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">mailparse_rfc822_parse_addresses</h1>
|
|
<p class="verinfo">(PECL mailparse >= 0.9.0)</p><p class="refpurpose"><span class="refname">mailparse_rfc822_parse_addresses</span> — <span class="dc-title">Parse RFC 822 compliant addresses</span></p>
|
|
|
|
</div>
|
|
<div class="refsect1 description" id="refsect1-function.mailparse-rfc822-parse-addresses-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>mailparse_rfc822_parse_addresses</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$addresses</code></span>
|
|
) : <span class="type">array</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Parses a <a href="http://www.faqs.org/rfcs/rfc822" class="link external">» RFC 822</a> compliant recipient
|
|
list, such as that found in the <em>To:</em> header.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.mailparse-rfc822-parse-addresses-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">addresses</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
A string containing addresses, like in:
|
|
<em>Wez Furlong <wez@example.com>, doe@example.com</em>
|
|
</p>
|
|
<blockquote class="note"><p><strong class="note">Note</strong>:
|
|
<p class="para">
|
|
This string must not include the header name.
|
|
</p>
|
|
</p></blockquote>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.mailparse-rfc822-parse-addresses-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns an array of associative arrays with the following keys for each
|
|
recipient:
|
|
<table class="doctable informaltable">
|
|
|
|
<tbody class="tbody">
|
|
<tr>
|
|
<td><em>display</em></td>
|
|
<td>
|
|
The recipient name, for display purpose. If this part is not set for a
|
|
recipient, this key will hold the same value as
|
|
<em>address</em>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><em>address</em></td>
|
|
<td>The email address</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td><em>is_group</em></td>
|
|
<td><strong><code>TRUE</code></strong> if the recipient is a newsgroup, <strong><code>FALSE</code></strong> otherwise.</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.mailparse-rfc822-parse-addresses-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-4048">
|
|
<p><strong>Example #1 <span class="function"><strong>mailparse_rfc822_parse_addresses()</strong></span> example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /><br />$to </span><span style="color: #007700">= </span><span style="color: #DD0000">'Wez Furlong <wez@example.com>, doe@example.com'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mailparse_rfc822_parse_addresses</span><span style="color: #007700">(</span><span style="color: #0000BB">$to</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程会输出:</p></div>
|
|
<div class="example-contents screen">
|
|
<div class="cdata"><pre>
|
|
array(2) {
|
|
[0]=>
|
|
array(3) {
|
|
["display"]=>
|
|
string(11) "Wez Furlong"
|
|
["address"]=>
|
|
string(15) "wez@example.com"
|
|
["is_group"]=>
|
|
bool(false)
|
|
}
|
|
[1]=>
|
|
array(3) {
|
|
["display"]=>
|
|
string(15) "doe@example.com"
|
|
["address"]=>
|
|
string(15) "doe@example.com"
|
|
["is_group"]=>
|
|
bool(false)
|
|
}
|
|
}
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |