Find And Replace

Discussion in 'PHP' started by !Unreal, Oct 28, 2008.

  1. #1
    Is there a way to search inside a file then replace an element of it with something else?

    For example, I would want to find an adsense ID then replace it with another. But because the adsense ID would always be different I wouldn't be able to find it. So would there be a way around this?

    Regards, Unreal
     
    !Unreal, Oct 28, 2008 IP
  2. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #2
    You mean replacing the adsense id in the <script></script> provided by google?

    I think you can do it because the line always start with the same word..right?
    If yeah, you can do it using a good text editor & regular expression =D. Backup before doing so.

    Its been long time since i use google ads, so i forgot how the script look like. lol
     
    ads2help, Oct 28, 2008 IP
  3. !Unreal

    !Unreal Well-Known Member

    Messages:
    1,671
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    165
    #3
    It would need to be automatically done through PHP. Manually would take to long to change it on all the pages.
     
    !Unreal, Oct 29, 2008 IP