PHP Salt


A little dash of PHP... my collection of php functions

Version: 2.25.1
Last Build: July 17, 2019 09:07am (PST)

Main Menu

Home

Get PHP Salt


The Functions

array
db
file
graph
html
mail
math
misc
mobile
script
string
system
time
psDirList()
Dir - list of Dir


Description:

Returns an (array) list of subdir in a directory
Key is set to "dir_searched/dir"



Usage:

$aryList = psDirList("/tmp");



Example:







Code:

function psDirList($wDir)
{
if (file_exists($wDir) == false) { return; }
$handle = opendir($wDir);
while (false !== ($entry = readdir($handle)))
{
if ($entry != "." && $entry != "..")
{
if ( is_dir("$wDir/$entry") == true ) { $res["$wDir/$entry"] = $entry; }
}
}
closedir($handle);

@asort($res);
return $res;
}



Changlelog:


See Also

And a shot out to:

PHP - php.net
Fedora Server - getfedora.com
Shameless ads to pay for site