Program that can search for particular words within a PHP file?

Discussion in 'Programming' started by webtracker, Oct 14, 2006.

  1. #1
    Does anyone know of a program that will scan directories for user defined words? I tried XP's search and it doesn't look like it'll search within php code. I have a lot of PHP files and I'm trying to translate certain parts and a tool like this would make it much easier.

    Any ideas?

    Thanks
     
    webtracker, Oct 14, 2006 IP
  2. sam2698

    sam2698 Well-Known Member

    Messages:
    941
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    118
    #2
    I think dreaweaver has this function. I am not sure.
     
    sam2698, Oct 14, 2006 IP
  3. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Zend Studio, if not THE best PHP IDE, has a file search like that.
     
    T0PS3O, Oct 14, 2006 IP
  4. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Have you considered writing a PHP script to edit the files?

    If dreamweaver can do this then that would probably be easier but a PHP script is an alternative.
     
    streety, Oct 14, 2006 IP
  5. webtracker

    webtracker Peon

    Messages:
    108
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks...I'll have a look.
     
    webtracker, Oct 14, 2006 IP
  6. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #6
    maybe you can bulk rename all those files to .txt through the command line before you perform the search. do a complete copy of the entire root directory and then perform the bulk renames so that you don't get mixed up with the existing .txt files... ;)
     
    daboss, Oct 14, 2006 IP
  7. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #7
    And if you stick your files on Linux you can 'grep' a whole hard disk and find a single word in seconds.
     
    T0PS3O, Oct 14, 2006 IP
  8. daboss

    daboss Guest

    Messages:
    2,249
    Likes Received:
    151
    Best Answers:
    0
    Trophy Points:
    0
    #8
    you sure? :p :eek:
     
    daboss, Oct 14, 2006 IP
  9. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Yes, I'm sure. On my server (not 100s of GB) I Grep a short phrase and find the file in seconds.
     
    T0PS3O, Oct 14, 2006 IP
  10. Phynder

    Phynder Well-Known Member

    Messages:
    2,603
    Likes Received:
    145
    Best Answers:
    0
    Trophy Points:
    178
    #10
    I am sure - grep rocks.

    On the Windoze plaform you can use the close relative to grep -> find:

    find "text you are looking for" filename

    use it at the command line
     
    Phynder, Oct 14, 2006 IP
  11. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #11
    I use EditPlus for php coding. It has a search in files feature.

    You select a folder and if it should travel to sub-folders, give it a search term and bam, it finds the files with the search term in them.

    Then you can open each by clicking and you'll go right to the line the search term was found on.

    Then you can use search and replace in all open files to change it.

    Now after typing all of that, I hope I understood the question.

    IIRC ged can do the replace by itself or with a little help from grep. ged and grep, two handy linux CL utilities.
     
    noppid, Oct 14, 2006 IP