mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 22:06:57 +08:00
111 lines
4.8 KiB
HTML
111 lines
4.8 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>Streams data from source file pointer, apply encoding and write to destfp</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.mailparse-stream-encode" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">mailparse_stream_encode</h1>
|
||
<p class="verinfo">(PECL mailparse >= 0.9.0)</p><p class="refpurpose"><span class="refname">mailparse_stream_encode</span> — <span class="dc-title">
|
||
Streams data from source file pointer, apply encoding and write to destfp
|
||
</span></p>
|
||
|
||
</div>
|
||
<div class="refsect1 description" id="refsect1-function.mailparse-stream-encode-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>mailparse_stream_encode</strong></span>
|
||
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$sourcefp</code></span>
|
||
, <span class="methodparam"><span class="type">resource</span> <code class="parameter">$destfp</code></span>
|
||
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$encoding</code></span>
|
||
) : <span class="type">bool</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
Streams data from the source file pointer, apply
|
||
<code class="parameter">encoding</code> and write to the destination file pointer.
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.mailparse-stream-encode-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">sourcefp</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
A valid file handle. The file is streamed through the parser.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">destfp</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
The destination file handle in which the encoded data will be written.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">encoding</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
One of the character encodings supported by the
|
||
<a href="ref.mbstring.html" class="link">mbstring</a> module.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.mailparse-stream-encode-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
成功时返回 <strong><code>TRUE</code></strong>, 或者在失败时返回 <strong><code>FALSE</code></strong>。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 examples" id="refsect1-function.mailparse-stream-encode-examples">
|
||
<h3 class="title">范例</h3>
|
||
<p class="para">
|
||
<div class="example" id="imap-search.examples">
|
||
<p><strong>Example #1 <span class="function"><strong>mailparse_stream_encode()</strong></span> example</strong></p>
|
||
<div class="example-contents">
|
||
<div class="phpcode"><pre><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php<br /><br /></span><span style="color: #FF8000">// email.eml contents: hello, this is some text=hello.<br /></span><span style="color: #0000BB">$fp </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'email.eml'</span><span style="color: #007700">, </span><span style="color: #DD0000">'r'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$dest </span><span style="color: #007700">= </span><span style="color: #0000BB">tmpfile</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">mailparse_stream_encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">, </span><span style="color: #0000BB">$dest</span><span style="color: #007700">, </span><span style="color: #DD0000">"quoted-printable"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">rewind</span><span style="color: #007700">(</span><span style="color: #0000BB">$dest</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Display new file contents<br /></span><span style="color: #0000BB">fpassthru</span><span style="color: #007700">(</span><span style="color: #0000BB">$dest</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>
|
||
hello, this is some text=3Dhello.
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
</div></div></div></body></html> |