<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.filesystem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.tmpfile.php',
    1 => 'tmpfile',
    2 => 'Crea un file temporaneo',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Filesystem Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.tempnam.php',
    1 => 'tempnam',
  ),
  'next' => 
  array (
    0 => 'function.touch.php',
    1 => 'touch',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/filesystem/functions/tmpfile.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.tmpfile" class="refentry">  
   <div class="refnamediv">  
    <h1 class="refname">tmpfile</h1>  
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">tmpfile</span> &mdash; <span class="dc-title">Crea un file temporaneo</span></p>
  
   </div>  
  <div class="refsect1 unknown-673" id="refsect1-function.tmpfile-unknown-673">  
    <h3 class="title">Descrizione</h3>  
    <div class="methodsynopsis dc-description">  
     <span class="methodname"><strong>tmpfile</strong></span>(): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>
  
       <p class="para rdfs-comment">  Crea un file temporaneo con un nome univoco in modalità di lettura-scrittura (w+), 
       restituendo un riferimento al file simile a quello tornato da <span class="function"><a href="function.fopen.php" class="function">fopen()</a></span>. 
       Il file viene automaticamente cancellato una volta chiuso (usando 
       <span class="function"><a href="function.fclose.php" class="function">fclose()</a></span>), o quando lo script termina. 
       </p>  
        <p class="para">  Per dettagli, consulta la documentazione del tuo sistema sulla funzione 
        <code class="literal">tmpfile(3)</code>, così come il file haeader 
        <var class="filename">stdio.h</var>. 
       </p>  
       <p class="para">  
        <div class="example" id="example-1">  
          <p><strong>Example #1 <span class="function"><strong>tmpfile()</strong></span> example</strong></p>  
          <div class="example-contents"> 
         <div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php <br />         $temp </span><span style="color: #007700">= </span><span style="color: #0000BB">tmpfile</span><span style="color: #007700">(); <br />         </span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$temp</span><span style="color: #007700">, </span><span style="color: #DD0000">"writing to tempfile"</span><span style="color: #007700">); <br />         </span><span style="color: #0000BB">fseek</span><span style="color: #007700">(</span><span style="color: #0000BB">$temp</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br />         echo </span><span style="color: #0000BB">fread</span><span style="color: #007700">(</span><span style="color: #0000BB">$temp</span><span style="color: #007700">, </span><span style="color: #0000BB">1024</span><span style="color: #007700">);<br />         </span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$temp</span><span style="color: #007700">);  </span><span style="color: #FF8000">// this removes the file <br />         </span><span style="color: #0000BB">?&gt;</span></span></code></div>  
              </div>
  
              <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
              <div class="example-contents screen">  
         <div class="cdata"><pre>
         writing toi tempfile
         </pre></div>
              </div>  
             </div>
            </p> 
             <p class="para">  Vedere anche <span class="function"><a href="function.tempnam.php" class="function">tempnam()</a></span>. 
             </p>  </div>
  
             </div><?php manual_footer($setup); ?>