I need a php function or script that can check search php code to see if certain words are used.
Example: I want to be able to search PHP files written in my own php files on my server dynamically to see if the phrase $_SESSION
is used.
I need a php function or script that can check search php code to see if certain words are used.
Example: I want to be able to search PHP files written in my own php files on my server dynamically to see if the phrase $_SESSION
is used.
You're better of using the system
function in php with grep
and check the result output. Grep
is a very powerful tool on Linux.
system(grep -rl "string" /path);
You can also use a built in php function to search for $_SESSION
in your files.
$search_text = preg_grep($pattern, file($path));