Jump to content

Search the Community

Showing results for tags 'filemtime'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Hello All, I'm trying to show the modication date of a file with php output. I added the "filemtime" to the print() function but I want it to show the date and time rather than just numbers. Any help would be greatly appreciated Here's my source: <style type="text/css"> * { font-family: tahoma; font-size: 16px; } </style> <?php // open this directory $myDirectory = opendir("."); // get each entry while($entryName = readdir($myDirectory)) { $pathinfo = pathinfo($entryName); if($pathinfo['extension'] != 'php, ink') $dirArray[] = $entryName; } // close directory closedir($myDirectory); // count elements in array $indexCount = count($dirArray); Print ("$indexCount files<br>\n"); // sort 'em sort($dirArray); // print 'em print("<TABLE border=1 cellpadding=5 cellspacing=0 class=whitelinks>\n"); print("<TR><TH><a style='float:left;' href='/joe'>Go Back Home</a></TH><TH></TH><TH></TH><TH></TH></TR>\n"); print("<TR><TH>Filename</TH><th>Filetype</th><th>Filesize</th><th>Modified</th></TR>\n"); // loop through the array of files and print them all for($index=0; $index < $indexCount; $index++) { if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files print("<TR><TD><a href=\"$dirArray[$index]\">$dirArray[$index]</a></td>"); print("<td>"); print(filetype($dirArray[$index])); print("</td>"); print("<td>"); print(filesize($dirArray[$index])); print("</td>"); print("<td>"); print(filemtime($dirArray[$index])); print("</td>"); print("</TR>\n"); } } print("</TABLE>\n"); ?> Thank you all in advance
  2. I just noticed something while updating one of the sites I manage. I use this code in the footer that is included in every page on the site: <p> <?php $current_file_name = ($_SERVER['REQUEST_URI']); $current_path = ($_SERVER['DOCUMENT_ROOT']); $full_name = $current_path.$current_file_name; $last_modified = filemtime($full_name); print("This page last changed: "); print(date("F j, Y - h:i A", $last_modified)); ?> </p> However, here's what I found a tad odd. If you go to: http://westminsteratcrabapple.com/index.php you get the correct modification date/time. But, if you go to: http://westminsteratcrabapple.com/ it shows a different date/time, which is of the folder, not imdex.php. Any thoughts appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.