<?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.rename.php',
    1 => 'rename',
    2 => 'Rinomina un file o una directory',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Filesystem Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.realpath-cache-size.php',
    1 => 'realpath_cache_size',
  ),
  'next' => 
  array (
    0 => 'function.rewind.php',
    1 => 'rewind',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/filesystem/functions/rename.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

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

   </div>
   <div class="refsect1 unknown-658" id="refsect1-function.rename-unknown-658">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>rename</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$oldname</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$newname</code></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$context</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

    <p class="para rdfs-comment"> 
     Tenta di rinominare <code class="parameter">oldname</code> in
     <code class="parameter">newname</code>.
    </p> 
    <p class="para"> 
     Restituisce <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> in caso di successo, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
    </p>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Example #1 Esempio di uso di <span class="function"><strong>rename()</strong></span></strong></p>
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />rename</span><span style="color: #007700">(</span><span style="color: #DD0000">"/tmp/tmp_file.txt"</span><span style="color: #007700">, </span><span style="color: #DD0000">"/home/user/login/docs/my_file.txt"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

     </div>
    </p>
    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <p class="para">
      Nelle versioni di PHP precedenti alla 4.3.3, la funzione <span class="function"><strong>rename()</strong></span>
      non può rinominare file attraverso partizioni nei sistemi *nix.
     </p>
    </p></blockquote>
    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <span class="simpara">
      Dal PHP 5.0.0 <span class="function"><strong>rename()</strong></span> può anche essere utilizzata
      con <em>qualche</em> wrapper URL. Fare riferimento a <a href="wrappers.php" class="xref">Supported Protocols and Wrappers</a>
      per avere l&#039;elenco dei wrapper supportati da <span class="function"><strong>rename()</strong></span>.
     </span>
    </p></blockquote>
    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <span class="simpara">
      Il wrapper utilizzato per <code class="parameter">oldname</code> <em>DEVE</em>
      essere il medesimo utilizzato per <code class="parameter">newname</code>.
     </span>
    </p></blockquote>
    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <span class="simpara">
      Il parametro <code class="parameter">context</code> è stato aggiunto in PHP 5.0.0.
     </span>
    </p></blockquote>
    <p class="para">
     Vedere anche <span class="function"><a href="function.copy.php" class="function">copy()</a></span>,
     <span class="function"><a href="function.unlink.php" class="function">unlink()</a></span> e
     <span class="function"><a href="function.move-uploaded-file.php" class="function">move_uploaded_file()</a></span>.
    </p>
   </div>

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