Let’s say i have this php function called from multiple php files
do_something($var);
How can i find the files from which the function is called?
later edit: i want to do this on windows
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
At least some IDE‘s have a means of searching through your current project for all instances of certain variables, function calls, etc. If you are using an IDE, check its help.
If you are using a *nix system, you can use grep to search:
The above will search your current working directory for the text ‘do_something’ in all files ending with the ‘.php’ extension. You can expand this to search all subdirectories of the current directory using the find command:
Use ‘man grep’ and ‘man find’ from your *nix command line to learn more.
If you are on Windows, I believe the find command can do similar things, I am not as familiar with it, but the basic syntax should look something like: