note 101227 added to function.filesize
| From: | pp2006gr at yahoo dot gr | Date: | Fri, 03 Dec 2010 18:01:11 +0000 |
| Subject: | note 101227 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174591@lists.php.net to get a copy of this message | ||
Hi,
I have this php to list the files into a directory. I want also to add their size, can you fill or
make the script, thanks.
function file_list($dir)
{
global $d;
$dl = array();
if ($hd = opendir($dir))
{
while ($sz = readdir($hd))
{
if ((preg_match("/^\./",$sz)==0) && !is_dir($dir.$sz))
$dl[] = $sz;
}
closedir($hd);
}
asort($dl);
echo '<h3>Files:</h3><div id="links"><ul>';
foreach ($dl as $link)
{
echo '<li><a
href="'.$d.$link.'">'.$link.'</a></li>';
}
echo '</ul></div>';
}
$dir = "./".$d;
file_list($dir);
unset ($dir);
unset ($dl);
----
Server IP: 69.147.83.197
Probable Submitter: 94.66.156.87
----
Manual Page -- http://www.php.net/manual/en/function.filesize.php
Edit -- https://master.php.net/note/edit/101227
Del: integrated -- https://master.php.net/note/delete/101227/integrated
Del: useless -- https://master.php.net/note/delete/101227/useless
Del: bad code -- https://master.php.net/note/delete/101227/bad+code
Del: spam -- https://master.php.net/note/delete/101227/spam
Del: non-english -- https://master.php.net/note/delete/101227/non-english
Del: in docs -- https://master.php.net/note/delete/101227/in+docs
Del: other reasons-- https://master.php.net/note/delete/101227
Reject -- https://master.php.net/note/reject/101227
Search -- https://master.php.net/manage/user-notes.php