PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of Hannes Dorn   CDir   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample using CDir()
Class: CDir
Author: By
Last change: Better example then the last time.
More comments. Better PHP.
Date: 20 years ago
Size: 688 bytes
 

Contents

Class file image Download
<?php

// $Archive: /Homepages/cdir/sample.php $
// $Author: Hannesd $
// $Date: 24.09.03 1:52 $
// $Revision: 2 $

include_once 'dir.php';

$oDir = new CDir();

// Read my Directory, only htm, html and php files
// recursive, files, no directories
// add /cdir/ to any entry
// don't add files/dirs containing _vti_ or vssver.scc
$oDir->Read( "./", "(htm|html|php)\$", true, true, true, "/cdir/", "(_vti_)|(vssver.scc)" );

// Sort entries descending by fullname
$oDir->Sort( 'Fullname', false );

// Output
$oDir->Output();

// Do something
foreach( $oDir->aFiles as $aFile )
{
   
$sFullname = $oDir->FullName( $aFile );
    echo
"$sFullname<br>\n";
}

?>