<?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.file-exists.php',
    1 => 'file_exists',
    2 => 'Controlla se un file o directory esiste',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Filesystem Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.file.php',
    1 => 'file',
  ),
  'next' => 
  array (
    0 => 'function.file-get-contents.php',
    1 => 'file_get_contents',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/filesystem/functions/file-exists.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.file-exists" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">file_exists</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">file_exists</span> &mdash; <span class="dc-title">Controlla se un file o directory esiste</span></p>

   </div>
   <div class="refsect1 unknown-565" id="refsect1-function.file-exists-unknown-565">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>file_exists</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

    <p class="simpara">
     Restituisce <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> se il file o la directory specificata da
     <code class="parameter">filename</code> esiste; <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> altrimenti.
    </p>
    <p class="para">
     Sui sistemi Windows utlizzare <var class="filename">//computername/share/filename</var> oppure
     <var class="filename">\\computername\share\filename</var> per verificare file su dischi condivisi.
    </p>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Example #1 Verificare l&#039;esistenza di un file</strong></p>
      <div class="example-contents"> 
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php <br />$filename </span><span style="color: #007700">= </span><span style="color: #DD0000">'/path/to/foo.txt'</span><span style="color: #007700">; <br /> <br />if (</span><span style="color: #0000BB">file_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">)) { <br />    echo </span><span style="color: #DD0000">"il file </span><span style="color: #0000BB">$filename</span><span style="color: #DD0000"> esiste"</span><span style="color: #007700">; <br />} else { <br />    echo </span><span style="color: #DD0000">"Il file </span><span style="color: #0000BB">$filename</span><span style="color: #DD0000"> non esiste"</span><span style="color: #007700">; <br />} <br /></span><span style="color: #0000BB">?&gt;</span></span></code></div> 
      </div>
 
     </div> 
    </p> 
 
    <blockquote class="note"><p><strong class="note">Nota</strong>: <span class="simpara">I risultati di questa funzione 
saranno memorizzati. Vedere <span class="function"><a href="function.clearstatcache.php" class="function">clearstatcache()</a></span> per  
maggiori dettagli.</span></p></blockquote> 
 
    <div class="tip"><strong class="tip">Suggerimento</strong><p class="simpara">A partire da <code class="literal">PHP 5.0.0</code>, questa funzione può essere utilizzata con
<em>alcuni</em> URL wrappers.  Fare riferimento a 
<a href="wrappers.php" class="xref">Supported Protocols and Wrappers</a> per la lista di quali wrappers supportano le funzioni della famiglia
<span class="function"><a href="function.stat.php" class="function">stat()</a></span>.</p></div> 
 
    <p class="para"> 
     Vedere anche <span class="function"><a href="function.is-readable.php" class="function">is_readable()</a></span>, <span class="function"><a href="function.is-writable.php" class="function">is_writable()</a></span>, 
     <span class="function"><a href="function.is-file.php" class="function">is_file()</a></span> e <span class="function"><a href="function.file.php" class="function">file()</a></span>. 
    </p>
   </div>

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