https://code.google.com/p/php-line-counter/[
^]
$options = array(
'ignoreFolders' => explode(', ', '.svn, nbproject'),
'ignoreFiles' => explode(', ', 'jquery-1.5.js, jquery-1.5.min.js'),
'extensions' => explode(', ', 'php, js'),
'whitespace' => false,
'comments' => false,
);
$folder = new Folder('path/to/project', new Option($options));
$folder->init();
$lines = $folder->getLines();
$whitespace = $folder->getWhitespace();
$comments = $folder->getComments();