Re: [PHP] Search and replace a String in a file.

2004-06-24 Thread Justin Patrin
You need to do: $snr = new File_SearchReplace(...); On Thu, 24 Jun 2004 13:52:55 -0400, Eric L. Sammons <[EMAIL PROTECTED]> wrote: > > First let me thank you for pointing me to PEAR. Now for the problem. Here is > my code: > > require_once 'File/SearchReplace.php'; > > $ser

FWD: RE: [PHP] Search and replace a String in a file.

2004-06-24 Thread Eric L. Sammons
One last thing, I know someone will ask... Yes I have installed the PEAR package: pear info File_SearchReplace About File_SearchReplace-1.0.1 == Provides Package File_SearchReplace Summary Performs search and replace routines Description Provides var

RE: [PHP] Search and replace a String in a file.

2004-06-24 Thread Eric L. Sammons
First let me thank you for pointing me to PEAR. Now for the problem. Here is my code: File exists."; $snr = File_SearchReplace("server-temp", "server-$serverName", $nfile, $dir, false, $ignoreline); $snr -> doSearch();

Re: [PHP] Search and replace a String in a file.

2004-06-24 Thread Justin Patrin
There's a PEAR package for just this. :-) http://pear.php.net/package/File_SearchReplace On Thu, 24 Jun 2004 12:58:08 -0400, Eric L. Sammons <[EMAIL PROTECTED]> wrote: > > Being new to PHP this task seems to be little out of my reach right now. I > wonder if anyone could tell me how, as I read a

RE: [PHP] Search and replace a String in a file.

2004-06-24 Thread Jay Blanchard
[snip] Being new to PHP this task seems to be little out of my reach right now. I wonder if anyone could tell me how, as I read a file, line by line, search for and then replace a given string? Basically I will open the file, read its lines one by one and I want to replace Some-Name with Some-o