Re: [PHP-WIN] replacing file contents

2005-04-11 Thread Aidal
Oops, seems I can't do anything right today. It was M. Sokolewicz who had the solution but thanks to all who tried to help me in my noobiest hour. /Aidal "Aidal" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > DOH! Thanks Kevin for pointing out what should be the obvious !!! /hide

Re: [PHP-WIN] replacing file contents

2005-04-11 Thread Aidal
DOH! Thanks Kevin for pointing out what should be the obvious !!! /hides Ofcause, str_replace() I totally forgot about that one, maybe because I've just been using eregi_replace() a lot lately, I dunno. Anyway, everything works now as I should, thanks :o) /Aidal "M. Sokolewicz" <[EMAIL PROTECT

Re: [PHP-WIN] replacing file contents

2005-04-11 Thread Luis Moreira
FYI This script $body = "Test string xpto replace"; echo $body . ""; $body = eregi_replace("xpto", "before", $body); echo $body . ""; ?> works and produces this output Test string xpto replace Test string before replace Luis Luis Moreira wrote: Hi I, for one, have never done

Re: [PHP-WIN] replacing file contents

2005-04-11 Thread M. Sokolewicz
why are you using regexp-functions anyway? there's /absolutely/ no need for them in your case. I can only see disadvantages: 1 - they use more memory than str_replace 2 - they're slower than str_replace 3 - they're more complicated than str_replace Simply use str_replace, and it'll work just fine

Re: [PHP-WIN] replacing file contents

2005-04-11 Thread Kevin Smith
Hi, It's none of that. I suspect that the problem lies with the "?" question mar and the full-stop. If you look up what the question mark and full-stop means in an expression, you will find the answer to your problem. Basically you need to escape the question mark, so it is not evaluated as pa

Re: [PHP-WIN] replacing file contents

2005-04-11 Thread Luis Moreira
Hi I, for one, have never done this, but if you are working with html files, I suppose you open it with your browser ? Have you cleared the cache, or at least forced the browser to re-open the file ? If you edit the file after the change using a text editor, do you see the changes, or n

[PHP-WIN] replacing file contents

2005-04-11 Thread Aidal
Hi NG. I'm having trouble searching through a file and swapping specific phrases with other phrases. I'm opening a html-file and i wish to replace "index2.php?someVar=SomeValue" with somthing else but I can't get this to work properly. first i open the html file and read all it's contents into