News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate's Blog:
Search & replace in files using php
May 12, 2009 @ 09:30:47

On his blog today Sameer Borate has posted a quick tutorial on how to use a PEAR package to do search and replace on your files from inside of PHP.

Searching and replacing content in files is a common task all of us do regularly. [...] Search/replace is easier from a shell prompt or an editor, but what if you have to do the same programatically in php. File_SearchReplace is a pear package that helps you search/replace in files through a nice object oriented interface.

Installation is simple (via the "pear" command line tool) and using it is just as easy. He gives a few examples of how it can be used - everything from a simple find and replace out to a more complicated regular expression search to be replaced with a string.

0 comments voice your opinion now!
search find replace pear package filesearchreplace tutorial regularexpression


blog comments powered by Disqus

Similar Posts

DevShed: Adding Validation to an Image Generator Class with PHP 5

Peter Petermann: Composer & Virtual Packages

MT-Soft Blog: Creating a secure PHP production environment from Source Code

Padraic Brady's Blog: Google roll out OAuth Authorisation to all Google Data APIs

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 2)


Community Events

Don't see your event here?
Let us know!


interview voicesoftheelephpant laravel5 library api podcast conference unittest release extension psr7 development opinion laravel wordpress series language community framework introduction

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework