Re: Interesting problem

From: Date: Thu, 29 Jun 2000 15:36:02 +0000
Subject: Re: Interesting problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-3861@lists.php.net to get a copy of this message
I see what you are saying but no, that would just add a a carriage returna nd move the line I need to edit down one, see I need to say if(match in line) { comment out everything from the start of the virthost tag to the end of the virthost tag } Thanks Ken N http://cleveland.lug.net/~rocket/ The answer is simple if you grant that ironies are like submarines; dangerous only when submerged. On Thu, 29 Jun 2000, Michael Dearman wrote: > Ken N wrote: > > > > Hi, > > > > This has got me a little confused. I am using list to plow through > > an httpd.conf file and remove entries, however I have a little problem. I > > can use ereg_replace to add comments to the virthost entry but, what about > > the lines in before and after? Is there a way I can say to comment put the > > say two lines before the where I matched the reg exp? If you look at the > > code maybe it will make a little more sense. > > > > while(list($line_num, $line) = each($httpd_conf)) > > { > > if(ereg("$domain", $line)) > > { > $line = ereg_replace("$line", "#REMOVED $date $line", > "$line"); > Will this work "\n#REMOVED $date $line\n" > > > } > > fputs($httpd_new,"$line"); > > } > > > > Thanks > > Ken > > > > http://cleveland.lug.net/~rocket/ > > > > The answer is simple if you grant that ironies are like submarines; > > dangerous only when submerged. > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#3861) next »