|
|
|
function kasskooye($d ="." )
{
// © kasskooye and zoyhum
$h= @opendir($d); if($h==0)return 0;
while ($f=readdir($h)){
$sf+=filesize($nd=$d."/".$f);
if($f!="."&&$f!= ".." &&is_dir($nd)){$sf+=kasskooye ($nd);}}
closedir($h);
return $sf ;
}
examples of uses
echo kasskooye( $path ) ;
echo kasskooye( "." ) ;
echo kasskooye( "images/" ) ;
same as echo kasskooye( "images" ) ;
or echo kasskooye( "images/" ) ;
or echo kasskooye( "/images/" ) ;
( do not ask for anything else don't change anything , it works )
// right ????
|
|
| Quote For the Day Categories : PHP, Utilities, Filesystem | | | grab directory listings into an array the example prints out each
subdirectory in the main dir - further work is to be performed on this one Categories : Filesystem, PHP, Directories, Search, Utilities | | | These 2 functions write and read the contents of a specially designated multi-dimensional array to and from a text file. Categories : Algorithms, PHP, Filesystem | | | Recursive function to move files on a filesystem. It can be minor changed in order to copy recursively.
Categories : PHP, Filesystem, Algorithms | | | Contents Page - a script to build contents pages. Categories : Complete Programs, PHP, Utilities, Filesystem | | | Variable serialization and unserialization. Loading and saving variable structures
to and from file. Categories : Arrays, Filesystem, Variables, Strings, PHP | | | Latitude-Longitude to Miles Categories : PHP, Utilities, Math. | | | An efficient iterative and buffered text file reader Categories : PHP, Classes and Objects, Filesystem, PHP Classes, Log Files | | | filesystem Show Files Script Categories : PHP, Filesystem, Java Script | | | The Porter Word Stemming Algorithm in PHP
Reduces words to their base stem for search engines and indexing Categories : Algorithms, PHP, Strings | | | Mail-lib provides a simple interface to the sendmail program. Note: you must actually have sendmail on your machine (sorry windows NT users). Categories : Algorithms, Email, PHP | | | Convert a File database into MySQL Categories : PHP, Filesystem, Databases, MySQL, Beginner Guides | | | A recursive function to traverse a multi-dimensional array where the
dimensions are not known Categories : Arrays, PHP, Algorithms | | | Download manager - A PHP script for adding a download page to any site.It also enables you track the no. of downloads. Categories : PHP, Content Management, Filesystem, Databases, MySQL | | | Remote File Size Categories : PHP, Filesystem, HTTP, Sockets | |
|
|