how to replace the same phrase in all pages

Discussion in 'PHP' started by digitalspace, Apr 3, 2008.

  1. #1
    i have a site with 100 pages also, and with the same title, say "good morning", now i have 100 line different phrases, how to use php to replace each page's "good morning" with each different phrase?
     
    digitalspace, Apr 3, 2008 IP
  2. greatlogix

    greatlogix Active Member

    Messages:
    664
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    85
    #2
    Why don't you use Dreamweaver's Find & Replace utility?
     
    greatlogix, Apr 3, 2008 IP
  3. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #3
    You can use PSPAD editor first download all files on local disk in a folder then take a backup of all files (subdirectorywise).

    Then open any file in pspad and there is an option to search and replace in multiple files

    Regards

    Alex
     
    kmap, Apr 3, 2008 IP
  4. kendo1979

    kendo1979 Peon

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    manual mate. unless you want to do bulk changing let say all "good morning" to "good night"

    you could try actual search and replace. it's a wonderful program.
     
    kendo1979, Apr 3, 2008 IP
  5. Ikki

    Ikki Peon

    Messages:
    474
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That's impossible mate. As kendo said: manual. If it was replacing one phrase for a new one then it's not big deal but since you want to change 1 phrase for different phrases... that's just not possible.

    So your options are: do it yourself manually or hire someone to do it for you... manually.

    P.S.: if you do find a way to do it automatically it will be a life saver for all of us xD
     
    Ikki, Apr 3, 2008 IP
  6. digitalspace

    digitalspace Banned

    Messages:
    347
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    for example, good moring in a.htm, b.htm, c.htm. now i have 3 phrease: one, two, three. i want to use php to let good morning in a.htm becomes one, and good morning in b.htm becomes two, good morning in c.htm becomes three.
     
    digitalspace, Apr 3, 2008 IP
  7. Mr.Shawn

    Mr.Shawn Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Sorry. I'm lost here. Isn't it the same?
     
    Mr.Shawn, Apr 3, 2008 IP
  8. digitalspace

    digitalspace Banned

    Messages:
    347
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    to make the question simple, how to use php to replace a phrase in a web page?
     
    digitalspace, Apr 4, 2008 IP
  9. bokiatenxi

    bokiatenxi Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    dude, if you want a certain phrase to be change dynamically, make it a variable, for example change the phrase "good morning" to <?php echo $my_phrase; ?>, then on the php code before this line you set $my_phrase to the phrase you want to show, for example, <?php $my_phrase = "good afternoon"; ?>.

    Makes sense?
     
    bokiatenxi, Apr 4, 2008 IP
  10. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #10
    jayshah, Apr 4, 2008 IP