Page 1 of 1

Removing code from files in batch using php

Posted: Tue May 12, 2009 9:35 am
by thiscatis
Is there a way to remove a portion of code (always the same lines of code)
from mutliple files at once using php?
So it loops through different pages on the ftp, opens it, looks for the code, replaces it with a blank, save and close.
Or is there a better method to do this?

Thanks in advance phpdev'ers

Re: Removing code from files in batch using php

Posted: Tue May 12, 2009 9:42 am
by Hightower
There would be a way to do this, but before I help you with the code would it not be easier to use grep?

http://www.gnu.org/software/grep/

Re: Removing code from files in batch using php

Posted: Tue May 12, 2009 9:54 am
by Yossarian
Try this google search : "php search and replace recursive"