count lines in a PHP project

Duncan Benoit picture Duncan Benoit · Apr 26, 2009 · Viewed 35.6k times · Source

Do you know any tool which can count all the code lines from a PHP project?

Answer

Henrik Paul picture Henrik Paul · Apr 26, 2009

On a POSIX operating system (e.g. Linux or OS X) you can write the following into your Bash shell:

wc -l `find . -iname "*.php"`

This will count the lines in all php-files in the current directory and also subdirectories. (Note that those single 'quotes' are backticks, not actual single quotes)