From: "Steve Buehler" <[EMAIL PROTECTED]>

>          Thank you so much for this.  I was thinking of it all wrong when
> doing this.   I have a couple of other questions to go along with this.
> 1.  How would I change this to do a recursive search for the .php files
> instead of just the *.php or */*.php in the glob?

Make a recursive function and use the opendir() / readdir() functions. Use
is_dir() to see if the file is a directory, and if so, call the function
again passing the new directory. If it's not, grab the last four characters
looking for ".php" to see if you should open/replace/rewrite the file.

> 2.  I also have some dns zone files that I was going to modify this script
> to replace some information in them.  What it would have to do is to
delete
> all lines that have white space (could be a space or a tab) NS more white
> space and then add specific lines that I want in place of the deleted
lines.
>          2.a.  There will normally be between 2 and 4 lines that I want
> deleted and 2 to replace them.

Same method. You'd probably want to use a regular expression to get rid of
the lines and insert the replacement text.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to