$dir = dirname(__FILE__); $files = scandir($dir); foreach($files as $name){
if($name == '.' || $name == '..'){ continue; }
$title = preg_replace("/Controller.*?php/",'',$name);
$file = fopen($name,"r"); $content = array(); while(!feof($file)){
$line_content = fgets($file);
preg_match("/publics+function/", $line_content, $pat_array);
if(isset($pat_array[0])){
$line_content = preg_replace("/.*?function|(.*?{|s+/",'',$line_content); $content[] = $title.'/'.$line_content; } } fclose($file); print_r($content); }