PHP counts the total number of files and lines of code in the directory, executes the statistics of files in the directory
When skipping files: The matching rules only start from the file name, and the matching rules are limited to the beginning.
Skip the comment lines in the file: The matching rules are only matched from the head of the comment paragraph. If // and *, lines starting with # and /* and blank lines appear, was skipped. Therefore, sweaty comments like /* must be preceded by an * sign at the beginning of each line, otherwise such comments cannot be matched.
Directory filtering: The matching rule is to match the full name of the directory name
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
21Jul2016
PHP counts the total number of files and lines of code in the directory (removing comments and blank lines). ?php /** * @author xiaoxiao x_824@sina.com 2011-1-12 * @link http://xiaoyaoxia.cnblogs.com/ * @license * Count the number of file lines and total number of files in the directory··Remove Comment*/ $obj = new
29Jul2016
What file is ftnstat.stat: What file is ftnstat.stat? The total number of files and lines of code in the PHP statistics directory (remove comments and blank lines): 2011 -1-12 * @link http://xiaoyaoxia.cnblogs.com/ * @license * Count the number of file lines and total number of files in the directory··Remove comments*/ $obj = new CaculateFiles(); //If set is false, this will not
21Aug2017
PHP counts the total number of files and lines of code in the directory, and executes the statistics of files in the directory. When skipping files: the matching rules only start from the file name, and the matching rules are limited to the beginning. Skip comment lines in the file: The matching rules are only matched from the head of the comment paragraph. If // and *, lines starting with # and /* and blank lines appear, they will be skipped. Therefore, sweaty comments like /* must be preceded by an * sign at the beginning of each line, otherwise such comments cannot be matched. Directory filtering: The matching rule is to match the full name of the directory name
27Dec2022
This article mainly introduces you to the relevant knowledge about PHP statistics, and talks about how to use PHP to count the number of lines of code and the number of files. I hope it will be helpful to friends in need!
28Feb2024
This article will introduce and demonstrate several methods for counting directory files in PHP. Using FilesystemIterator class in php to count the number of files in a directory PHP provides the FilesystemIterator class, which is an elegant way to count files in a directory. This class contains a number of functions and constants that perform various operations for iterating the file system. Use the iterator_count() function to count the number of elements in an iterator. Let us consider the following directory structure. myDir├──abc.html├──abc.jpeg├──abc.php└──abc.png First, create a variable $iterator and store Files
26Dec2017
How to efficiently count the number of lines in large files in PHP? This article mainly shares examples of ultra-fast and efficient counting of lines in large files in PHP. I hope to be helpful.
Hot Tools
Powerful php file upload class
Powerful php file upload class
PHP multi-file upload class that supports watermarks, dates, and thumbnails
PHP multi-file upload class that supports watermarks, dates, and thumbnails
PHP supports single or multiple file upload classes
PHP supports single or multiple file upload classes