PHP Classes

File: test.fuzzyfiledate.php

Recommend this page to a friend!
  Classes of Andrew Collington   Fuzzy File Times   test.fuzzyfiledate.php   Download  
File: test.fuzzyfiledate.php
Role: Example script
Content type: text/plain
Description: A slightly more extensive example of the fuzzy file date class
Class: Fuzzy File Times
Author: By
Last change:
Date: 22 years ago
Size: 728 bytes
 

Contents

Class file image Download
<?php

   
require("class.fuzzyfiledate.php");
   
$fd = new FuzzyFileDate();

   
GetFileList($files);
   
    foreach (
$files as $file)
    {
       
$fd->GetFileDates($file);
        echo
"<br>times for {$file}<br><br>\n\n";
        echo
"ctime: {$fd->file[fuzzy_ctime]} ({$fd->file[ctime]})<br>\n";
        echo
"mtime: {$fd->file[fuzzy_mtime]} ({$fd->file[mtime]})<br>\n";
        echo
"atime: {$fd->file[fuzzy_atime]} ({$fd->file[atime]})<br>\n";
        echo
"<br><br>\n\n";
    }

    function
GetFileList(&$files)
    {
        if (!(
$handle=@opendir(".")))
        {
            return;
        }
        while (
$node = @readdir($handle))
        {
           
$nodebase = @basename($node);
            if (
$nodebase!="." && $nodebase!="..")
            {
                if (
is_file($node)) $files[] = $node;
            }
        }
    }

?>