Removing code from files in batch using php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Removing code from files in batch using php

Post 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
User avatar
Hightower
Forum Newbie
Posts: 22
Joined: Tue May 12, 2009 7:09 am
Location: Durham, UK

Re: Removing code from files in batch using php

Post 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/
Yossarian
Forum Contributor
Posts: 101
Joined: Fri Jun 30, 2006 4:43 am

Re: Removing code from files in batch using php

Post by Yossarian »

Try this google search : "php search and replace recursive"
Post Reply