I use AMFPHP and this little ditty:

<?php
/*
--------------------------------------
AMFPHP Service Class -----------------
directoryReader.php

I return an array of filenames

Author: Mike Britton
05/19/05

Methods:: ----------------------------
getFiles

*/

class directoryReader {

function directoryReader() {

$this->methodTable = array(
"getFiles" => array(
"description" => "I return all files.",
"access" => "remote",
"returns" => "array",
"arguments" => array("argDir")
)
);

}


function getFiles($argDir) {
$dir = opendir($argDir);

$names = array();
$names['files'] = array();

while($file = readdir($dir)){
if($file != "." && $file != ".."){
$newAr = array();
$newAr['fn'] = $file;
array_push($names['files'],$file);
}
}

// Newest to oldest
$result = array_reverse($names['files'],false);
// Oldest to newest
//$result = array_reverse($names['files'],true);

return $result;

}
}

?>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to