$path, 'name' => end($subdirectories), 'kind' => 'directory', 'content' => scan_directory_recursively($path, $filter)); }elseif(is_file($path)) { $extension = end(explode('.',end($subdirectories))); if($filter === FALSE || $filter == $extension) { $directory_tree[] = array( 'path' => $path, 'name' => end($subdirectories), 'extension' => $extension, 'size' => filesize($path), 'kind' => 'file'); } if (strtolower($extension) == 'php') { parseFile($path); } } } } } closedir($directory_list); return $directory_tree; }else{ return FALSE; } } function parseFile($path) { $file_content = file_get_contents($path); $file_lines = split('\n', $file_content); $counter = 0; foreach ($file_lines as $line) { $matches = array(); $counter++; $matchCount = preg_match('/__[\s]*\(.*\)/', $line, $matches); if (count($matches) > 0) { foreach($matches as $match) echo($path.':'.$counter.' - '.$match.'
'); } } } $directory = 'E:/wamp/www/room/'; $file_tree = scan_directory_recursively($directory); ?>