Copy CodeThe code is as follows:
/**
* Calculate the programmed code, including the file number, the number of rows, the number of characters
*
* @version 1.0
* @since 1.0
* @access Public
* @author Ryan
* @copyright Copyright (c) 2002-2004 by Shiner Technologies Co., Ltd.
* @package Aaportal
*/
Please change the location of this catalogue
$dir = "Aaportal";
The following does not have to be
$counts = Array ("directory" = + 0, "file" = 0, "line" = 0, "size" = 0);
Check ($DIR);
echo "total:\n";
echo "Directry:". $counts ["directory"]. " \ n ";
echo "File:". $counts ["File"]. " \ n ";
echo "line:". $counts ["line"]. " \ n ";
echo "Size:". $counts ["Size"]. " \ n ";
function Check ($dir)
{
Global $counts;
if ($dh = Opendir ($dir)) {
while (($file = Readdir ($DH))!== false) {
if ($file = = ".") continue;
if ($file = = ".") continue;
if ($file = = "CVS") continue;
$path = $dir. " /". $file;
if (Is_dir ($path)) {
$counts ["Directory"]++;
echo "dir". $counts ["directory"]. "$path \ n";
Check ($path);
} else {
$ext = Array_pop (Explode ('. ', basename ($path)));
if ($ext = = "php" | | $ext = = "Inc") {
$counts ["File"]++;
echo "File". $counts ["File"]. "$path \ n";
$lines = file ($path);
$counts ["line"] + = count ($lines);
$counts ["size"] + = FileSize ($path);
}
}
}
Closedir ($DH);
}
}?>
The above describes the size of the PHP program you have developed, including aspects of the content, you want to be interested in PHP tutorial friends helpful.