12-10-2008, 05:20 AM
|
#1 (permalink)
|
|
The Acquainted
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
|
Count file in dir with matching $string at a line $var...
Good day to you all, I'm wondering how can I count files in a directory that as a specific word in a specific line number which would be :
PHP Code:
// I know how to count folder... function CountDir($aDir, $aRecurse) { $Count = 0; $d = dir($aDir); while ($Entry = $d->Read()) { if (!(($Entry == "..") || ($Entry == "."))) { if (Is_Dir($aDir . '/' . $Entry)) { if ($aRecurse) { $Count += CountDir($aDir . '/' . $Entry, $aRecurse); } } else { $Count++; } } } return $Count; } // I would need to include something like this iguess.. if ($lines[$line13] == "Pending"){ count++ }
Thanks !
__________________
That's why we are not alone on earth... let's build !
|
|
|
|