Login   Register  
PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 10 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)\$"truetruetrue"/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";
}

?>