<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.filemtime.php',
    1 => 'filemtime',
    2 => 'Lit la date de derni&egrave;re modification du fichier',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Fonctions sur les syst&egrave;mes de fichiers',
  ),
  'prev' => 
  array (
    0 => 'function.fileinode.php',
    1 => 'fileinode',
  ),
  'next' => 
  array (
    0 => 'function.fileowner.php',
    1 => 'fileowner',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/filesystem/functions/filemtime.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.filemtime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">filemtime</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">filemtime</span> &mdash; <span class="dc-title">Lit la date de dernière modification du fichier</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.filemtime-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>filemtime</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"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Lit la date à laquelle le fichier a été modifié pour la dernière fois.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.filemtime-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Chemin vers le fichier.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.filemtime-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Renvoie le timestamp Unix de dernière modification du fichier
   <code class="parameter">filename</code>  ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
   Il est possible d&#039;utiliser <span class="function"><a href="function.date.php" class="function">date()</a></span> sur ce résultat pour obtenir
   une date de modification humainement lisible.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.filemtime-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="para">
En cas d&#039;échec, une alerte de type <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> sera émise.
</p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.filemtime-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>filemtime()</strong></span></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: #FF8000">// Affichera : somefile.txt a été modifié le : December 29 2002 22:16:23.<br /><br /></span><span style="color: #0000BB">$filename </span><span style="color: #007700">= </span><span style="color: #DD0000">'somefile.txt'</span><span style="color: #007700">;<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">"</span><span style="color: #0000BB">$filename</span><span style="color: #DD0000"> a été modifié le : " </span><span style="color: #007700">. </span><span style="color: #0000BB">date </span><span style="color: #007700">(</span><span style="color: #DD0000">"F d Y H:i:s."</span><span style="color: #007700">, </span><span style="color: #0000BB">filemtime</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">));<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


 <div class="refsect1 notes" id="refsect1-function.filemtime-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">
 Notez que la précision temporelle peut varier selon le système de fichiers utilisé.
</p></p></blockquote>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">
 Les résultats de cette fonction sont mis en cache.
 Voyez la fonction <span class="function"><a href="function.clearstatcache.php" class="function">clearstatcache()</a></span> pour plus de détails.
</span></p></blockquote>
  <div class="tip"><strong class="tip">Astuce</strong><p class="simpara">
 À partir de PHP 5.0.0, cette fonction peut aussi être utilisée avec <em>quelques</em> protocoles url.
 Lisez <a href="wrappers.php" class="xref">Liste des protocoles et des gestionnaires support&eacute;s</a> pour connaître les protocoles supportant la famille de fonctionnalités de
 <span class="function"><a href="function.stat.php" class="function">stat()</a></span>.
</p></div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.filemtime-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.filectime.php" class="function" rel="rdfs-seeAlso">filectime()</a> - Renvoie la date de derni&egrave;re modification de l'inode d'un fichier</span></li>
    <li><span class="function"><a href="function.stat.php" class="function" rel="rdfs-seeAlso">stat()</a> - Renvoie les informations &agrave; propos d'un fichier</span></li>
    <li><span class="function"><a href="function.touch.php" class="function" rel="rdfs-seeAlso">touch()</a> - Modifie la date de modification et de dernier acc&egrave;s d'un fichier</span></li>
    <li><span class="function"><a href="function.getlastmod.php" class="function" rel="rdfs-seeAlso">getlastmod()</a> - Retourne la date de derni&egrave;re modification de la page</span></li>
   </ul>
  </p>
 </div>

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