cvs: phpdoc /en/reference/filesystem/functions filemtime.xml

From: Date: Mon, 30 Dec 2002 06:44:50 +0000
Subject: cvs: phpdoc /en/reference/filesystem/functions filemtime.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969350488@lists.php.net to get a copy of this message
philip Mon Dec 30 01:44:50 2002 EDT Modified files: /phpdoc/en/reference/filesystem/functions filemtime.xml Log: Added example, see also getlastmod() and stat(), replaced date() info and removed the portion about "last modification date in a footer" Index: phpdoc/en/reference/filesystem/functions/filemtime.xml diff -u phpdoc/en/reference/filesystem/functions/filemtime.xml:1.2 phpdoc/en/reference/filesystem/functions/filemtime.xml:1.3 --- phpdoc/en/reference/filesystem/functions/filemtime.xml:1.2 Wed Apr 17 02:38:07 2002 +++ phpdoc/en/reference/filesystem/functions/filemtime.xml Mon Dec 30 01:44:49 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> <refentry id="function.filemtime"> <refnamediv> @@ -14,7 +14,8 @@ </methodsynopsis> <para> Returns the time the file was last modified, or &false; in case of - an error. The time is returned as a Unix timestamp. + an error. The time is returned as a Unix timestamp, which is + suitable for the <function>date</function> function. </para> <para> The results of this function are cached. See @@ -25,14 +26,31 @@ linkend="features.remote-files">remote files</link>; the file to be examined must be accessible via the server's filesystem. </simpara> - <para>Note: This function returns the time when the data + <para> + Note: This function returns the time when the data blocks of a file were being written to, that is, the time - when the content of the file was changed. Use - <function>date</function> on the result of this function - to get a printable modification date for use in page footers. + when the content of the file was changed. + </para> + <para> + <example> + <title><function>filemtime</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// outputs e.g. somefile.txt was last modified: December 29 2002 22:16:23. + +$filename = 'somefile.txt'; +if (file_exists($filename)) { + echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename)); +} +?> +]]> + </programlisting> + </example> </para> <para> - See also <function>filectime</function> and <function>touch</function>. + See also <function>filectime</function>, <function>stat</function>, + <function>touch</function>, and <function>getlastmod</function>. </para> </refsect1> </refentry>

« previous php.doc (#969350488) next »