Page 1 of 1

Searching PHP scripts for text strings

Posted: Tue Sep 09, 2014 8:33 am
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

Re: Searching PHP scripts for text strings

Posted: Tue Sep 09, 2014 8:38 am
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.

Re: Searching PHP scripts for text strings

Posted: Thu Sep 11, 2014 1:30 am
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.

Re: Searching PHP scripts for text strings

Posted: Sun Sep 14, 2014 5:46 pm
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