Re: Interesting problem
| From: | Kevin Beckford | Date: | Thu, 29 Jun 2000 20:08:19 +0000 |
| Subject: | Re: Interesting problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3875@lists.php.net to get a copy of this message | ||
>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?
use file() to read httpd.conf into an array line by line
then the key of that array will be the line number. When you match entry N,
then the line before it will be key N-1, and the one before it N+1. You now
should have the keys of the lines that you want to remove/comment out/whatever.
by the way, the PCRE functions are faster and more powerful than ereg.