uTools-Manuals/docs/php/recode_file.html
2019-04-08 23:22:26 +08:00

126 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>Recode from file to file according to recode request</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.recode-file" class="refentry">
<div class="refnamediv">
<h1 class="refname">recode_file</h1>
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">recode_file</span> &mdash; <span class="dc-title">Recode from file to file according to recode request</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.recode-file-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>recode_file</strong></span>
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$request</code></span>
, <span class="methodparam"><span class="type">resource</span> <code class="parameter">$input</code></span>
, <span class="methodparam"><span class="type">resource</span> <code class="parameter">$output</code></span>
) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
Recode the file referenced by file handle
<code class="parameter">input</code> into the file referenced by file
handle <code class="parameter">output</code> according to the recode
<code class="parameter">request</code>.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.recode-file-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">request</code></dt>
<dd>
<p class="para">
The desired recode request type
</p>
</dd>
<dt>
<code class="parameter">input</code></dt>
<dd>
<p class="para">
A local file handle <span class="type"><a href="language.types.resource.html" class="type resource">resource</a></span> for
the <code class="parameter">input</code>
</p>
</dd>
<dt>
<code class="parameter">output</code></dt>
<dd>
<p class="para">
A local file handle <span class="type"><a href="language.types.resource.html" class="type resource">resource</a></span> for
the <code class="parameter">output</code>
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.recode-file-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
Returns <strong><code>FALSE</code></strong>, if unable to comply, <strong><code>TRUE</code></strong> otherwise.
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.recode-file-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-3214">
<p><strong>Example #1 Basic <span class="function"><strong>recode_file()</strong></span> example</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$input&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'input.txt'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'r'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$output&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'output.txt'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">recode_file</span><span style="color: #007700">(</span><span style="color: #DD0000">"us..flat"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$input</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$output</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 notes" id="refsect1-function.recode-file-notes">
<h3 class="title">注释</h3>
<p class="para">
This function does not currently process file handles referencing
remote files (URLs). Both file handles must refer to local files.
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.recode-file-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="fopen.html" class="function" rel="rdfs-seeAlso">fopen()</a> - 打开文件或者 URL</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>