Php > File Manipulation sample source codes
A class to Get and Output Directories List
A class to Get and Output Directories List length; } function setLength ($fa_l) { $this->length=$fa_l; } function sortList () { sort($this->oa_names); } function printListKey ($fa_key) //print array element corresponding to a given key { echo $this->oa_names[$fa_key]; } function printListKeyLink ($fa_key) { echo "
oa_names[$fa_key]."\">".$this->oa_names[$fa_key]."
"; } function printList () { reset ($this->oa_names); while (list ($key, $val) = each ($this->oa_names)) { echo $val; echo "
"; } } function printListLink () { reset ($this->oa_names); while (list ($key, $val) = each ($this->oa_names)) { echo "
$val
".$key; echo "
"; } } function dirList ($fa_path='.') { $dr = dir($fa_path); //compteur $i=0; while($entry=$dr->read()) { if (is_dir($entry) && ($entry!=".") && ($entry!="..")) { $this->oa_names[$i]=$entry; $i++; } } $this->setLength($i); if ($i>0) { $this->sortList(); } } } ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage