<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.recode.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.recode-file.php',
    1 => 'recode_file',
    2 => 'Recode from file to file according to recode request',
  ),
  'up' => 
  array (
    0 => 'ref.recode.php',
    1 => 'Recode Functions',
  ),
  'prev' => 
  array (
    0 => 'function.recode.php',
    1 => 'recode',
  ),
  'next' => 
  array (
    0 => 'function.recode-string.php',
    1 => 'recode_string',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/recode/functions/recode-file.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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 &lt; 7.4.0)</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">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>recode_file</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$request</code></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$input</code></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$output</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   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">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">request</code></dt>
    <dd>
     <span class="simpara">
      The desired recode request type
     </span>
    </dd>
   
   
    <dt><code class="parameter">input</code></dt>
    <dd>
     <span class="simpara">
      A local file handle <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> for
      the <code class="parameter">input</code>
     </span>
    </dd>
   
   
    <dt><code class="parameter">output</code></dt>
    <dd>
     <span class="simpara">
      A local file handle <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> for
      the <code class="parameter">output</code>
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.recode-file-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, if unable to comply, <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> otherwise.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.recode-file-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
  <p><strong>Example #1 Basic <span class="function"><strong>recode_file()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$input </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'input.txt'</span><span style="color: #007700">, </span><span style="color: #DD0000">'r'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$output </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'output.txt'</span><span style="color: #007700">, </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">, </span><span style="color: #0000BB">$input</span><span style="color: #007700">, </span><span style="color: #0000BB">$output</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 notes" id="refsect1-function.recode-file-notes">
  <h3 class="title">Notes</h3>
  <p class="simpara">
   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">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.fopen.php" class="function" rel="rdfs-seeAlso">fopen()</a> - Opens file or URL</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>