/php/directoryiterator.getmtime.html
https://bitbucket.org/thncr/manuals · HTML · 95 lines · 80 code · 15 blank · 0 comment · 0 complexity · 0c1407f4caafb668eb18adb1331cbe34 MD5 · raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <title>Get last modification time of current DirectoryIterator item</title>
- </head>
- <body><div class="manualnavbar" style="text-align: center;">
- <div class="prev" style="text-align: left; float: left;"><a href="directoryiterator.getinode.html">DirectoryIterator::getInode</a></div>
- <div class="next" style="text-align: right; float: right;"><a href="directoryiterator.getowner.html">DirectoryIterator::getOwner</a></div>
- <div class="up"><a href="class.directoryiterator.html">DirectoryIterator</a></div>
- <div class="home"><a href="index.html">PHP Manual</a></div>
- </div><hr /><div id="directoryiterator.getmtime" class="refentry">
- <div class="refnamediv">
- <h1 class="refname">DirectoryIterator::getMTime</h1>
- <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">DirectoryIterator::getMTime</span> — <span class="dc-title">Get last modification time of current DirectoryIterator item</span></p>
- </div>
- <div class="refsect1 description" id="refsect1-directoryiterator.getmtime-description">
- <h3 class="title">说明</h3>
- <div class="methodsynopsis dc-description">
- <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><strong>DirectoryIterator::getMTime</strong></span>
- ( <span class="methodparam">void</span>
- )</div>
- <p class="para rdfs-comment">
- Get the last modification time of the current
- <a href="class.directoryiterator.html" class="classname">DirectoryIterator</a> item, as a Unix timestamp.
- </p>
- </div>
- <div class="refsect1 parameters" id="refsect1-directoryiterator.getmtime-parameters">
- <h3 class="title">参数</h3>
- <p class="para">此函数没有参数。</p>
- </div>
- <div class="refsect1 returnvalues" id="refsect1-directoryiterator.getmtime-returnvalues">
- <h3 class="title">返回值</h3>
- <p class="para">
- The last modification time of the file, as a Unix timestamp.
- </p>
- </div>
- <div class="refsect1 examples" id="refsect1-directoryiterator.getmtime-examples">
- <h3 class="title">范例</h3>
- <p class="para">
- <div class="example" id="example-3644">
- <p><strong>Example #1 A <span class="methodname"><strong>DirectoryIterator::getMTime()</strong></span> example</strong></p>
- <div class="example-contents"><p>
- Displays a list of the files in the directory of the script
- and their last modified times.
- </p></div>
- <div class="example-contents">
- <div class="phpcode"><code><span style="color: #000000">
- <span style="color: #0000BB"><?php<br />$iterator </span><span style="color: #007700">= new </span><span style="color: #0000BB">DirectoryIterator</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">));<br />foreach (</span><span style="color: #0000BB">$iterator </span><span style="color: #007700">as </span><span style="color: #0000BB">$fileinfo</span><span style="color: #007700">) {<br /> if (</span><span style="color: #0000BB">$fileinfo</span><span style="color: #007700">-></span><span style="color: #0000BB">isFile</span><span style="color: #007700">()) {<br /> echo </span><span style="color: #0000BB">$fileinfo</span><span style="color: #007700">-></span><span style="color: #0000BB">getFilename</span><span style="color: #007700">() . </span><span style="color: #DD0000">" " </span><span style="color: #007700">. </span><span style="color: #0000BB">$fileinfo</span><span style="color: #007700">-></span><span style="color: #0000BB">getMTime</span><span style="color: #007700">() . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /> }<br />}<br /></span><span style="color: #0000BB">?></span>
- </span>
- </code></div>
- </div>
- <div class="example-contents"><p>以上例程的输出类似于:</p></div>
- <div class="example-contents screen">
- <div class="cdata"><pre>
- apple.jpg 1240047118
- banana.jpg 1240065176
- index.php 1240047208
- pear.jpg 12240047979
- </pre></div>
- </div>
- </div>
- </p>
- </div>
- <div class="refsect1 seealso" id="refsect1-directoryiterator.getmtime-seealso">
- <h3 class="title">参见</h3>
- <p class="para">
- <ul class="simplelist">
- <li class="member"> <span class="methodname"><a href="directoryiterator.getatime.html" class="methodname" rel="rdfs-seeAlso">DirectoryIterator::getATime()</a> - Get last access time of the current DirectoryIterator item</span></li>
- <li class="member"> <span class="methodname"><a href="directoryiterator.getctime.html" class="methodname" rel="rdfs-seeAlso">DirectoryIterator::getCTime()</a> - Get inode change time of the current DirectoryIterator item</span></li>
- <li class="member"> <span class="function"><a href="function.filemtime.html" class="function" rel="rdfs-seeAlso">filemtime()</a> - 取得文件修改时间</span></li>
- </ul>
- </p>
- </div>
- </div><hr /><div class="manualnavbar" style="text-align: center;">
- <div class="prev" style="text-align: left; float: left;"><a href="directoryiterator.getinode.html">DirectoryIterator::getInode</a></div>
- <div class="next" style="text-align: right; float: right;"><a href="directoryiterator.getowner.html">DirectoryIterator::getOwner</a></div>
- <div class="up"><a href="class.directoryiterator.html">DirectoryIterator</a></div>
- <div class="home"><a href="index.html">PHP Manual</a></div>
- </div></body></html>