Searching PHP scripts for text strings

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
bowlesj
Forum Contributor
Posts: 179
Joined: Fri Jul 18, 2014 1:54 pm

Searching PHP scripts for text strings

Post by bowlesj »

Hi,

I tried a google search to solve this and found nothing. I tried searching this site and it didn't like my key words so I guess I am stuck on this one.

I tried a Windows 7 search to look for text strings within my php scripts but it does not search .php scripts. Is there a low cost or free utility to search for text strings within .php scripts. Preferably something that can list the whole line where the string is located and the script it came from. It would be best if it could search for "_SESSION*MyString" using wild card characters (even better if it could use regular expressions like unix Sed/Awk can). Again this is Win 7. I am using XAMPP.

Thanks,
John
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Searching PHP scripts for text strings

Post by Celauran »

Pretty sure you can use grep et al via Cygwin. Most editors/IDEs should handle what you're asking out of the box, though.
phpdeveloper1
Forum Newbie
Posts: 19
Joined: Tue Aug 12, 2014 6:13 am
Location: Chennai, India

Re: Searching PHP scripts for text strings

Post by phpdeveloper1 »

bowlesj wrote:Hi,

I tried a google search to solve this and found nothing. I tried searching this site and it didn't like my key words so I guess I am stuck on this one.

I tried a Windows 7 search to look for text strings within my php scripts but it does not search .php scripts. Is there a low cost or free utility to search for text strings within .php scripts. Preferably something that can list the whole line where the string is located and the script it came from. It would be best if it could search for "_SESSION*MyString" using wild card characters (even better if it could use regular expressions like unix Sed/Awk can). Again this is Win 7. I am using XAMPP.

Thanks,
John
Since you mention windows, I think notepad++ will suit your need pretty well.
Last edited by phpdeveloper1 on Sun Sep 14, 2014 8:04 pm, edited 1 time in total.
Chris, Php Developer and Programmer,
https://www.phpfreelanceprogrammer.com/
bowlesj
Forum Contributor
Posts: 179
Joined: Fri Jul 18, 2014 1:54 pm

Re: Searching PHP scripts for text strings

Post by bowlesj »

Thanks guys, sorry about the long time to reply. I was kind of forced into a bit of a forum holiday - LOL.

Gee, it was in notepad++ which I am using. It was under "find in files". I noticed it even does replace. That's so cool. Editors have come a long ways. They use to only search the current document.

John
Post Reply