<?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.touch.php',
    1 => 'touch',
    2 => 'Imposta l\'ora di modifica di un file',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Filesystem Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.tmpfile.php',
    1 => 'tmpfile',
  ),
  'next' => 
  array (
    0 => 'function.umask.php',
    1 => 'umask',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/filesystem/functions/touch.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.touch" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">touch</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">touch</span> &mdash; <span class="dc-title">Imposta l&#039;ora di modifica di un file</span></p>

   </div>
   <div class="refsect1 unknown-676" id="refsect1-function.touch-unknown-676">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>touch</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="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$time</code><span class="initializer"> = ?</span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$atime</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 impostare l&#039;ora di modifica del file indicato da 
     <code class="parameter">filename</code>. Se il parametro <code class="parameter">time</code>
     non è passato, usa l&#039;ora attuale. Ciò equivale a quello che fa utime
     (a volte indicato come utimes). Se è presente il terzo parametro opzionale
     <code class="parameter">atime</code> è presente, viene utilizzato per impostare
     l&#039;orario di accesso al file indicato.
     Occorre rilevare che l&#039;orario di accesso è sempre modificato, indipendentemente dal
     numero dei parametri.
    </p>
    <p class="para">
     Se il file non esiste, viene creato.
    </p>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Example #1 <span class="function"><strong>touch()</strong></span> example</strong></p>
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">touch</span><span style="color: #007700">(</span><span style="color: #0000BB">$FileName</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$FileName</span><span style="color: #DD0000"> modification time has been changed to present time"</span><span style="color: #007700">;<br />} else {<br />    echo </span><span style="color: #DD0000">"Sorry, could not change modification time of </span><span style="color: #0000BB">$FileName</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

     </div>
    </p>
   </div>

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