I have the code below which list files from directory and all sub directory and its working fine.
Now what I want to achieve is to only display PHP files that contains the following string functions eval, system, shell_exec.
I guess I have to create an array like
$check=array("unescape", "system(","shell_exec(");
Below is the code that just list all the PHP files
function c_check($path){
if(file_exists($path) && is_dir($path)){
$files = glob($path ."/*");
if(count($files) > 0){
// Loop through retuned array
foreach($files as $file){
if(is_file("$file")){
// Display only filename
echo basename($file) . "<br>";
} else if(is_dir("$file")){
c_check("$file");
}
}
} else{
echo " directory file not found";
}
} else {
echo " directory does not exist.";
}
}
// Call the function
c_check("../content_folder");