PHP Classes

File: usage.php

Recommend this page to a friend!
  Classes of Rupom Razzaque   Text Search Replace   usage.php   Download  
File: usage.php
Role: Example script
Content type: text/plain
Description: Example Usage
Class: Text Search Replace
Search files and replace their content
Author: By
Last change: Need to change my blog URL
Date: 15 years ago
Size: 1,040 bytes


Class file image Download
* Class : TextSearch
* @author : MA Razzaque Rupom <>, <>
* Moderator, phpResource Group(
* URL:
* @version : 1.0
* Date : 06/25/2006
* Purpose : Searching and replacing text within files of specified path


$path = "/projects/rupom/Recent_FDD/Very_Imps"; //setting search path
$logFile = "/projects/rupom/test_search/searchResult.txt"; //setting log file
$obj = new TextSearch();
$obj->setExtensions(array('html','txt')); //setting extensions to search files within
$obj->addExtension('php');//adding an extension to search within
$obj->setReplacementKey('phpResource');//setting replacement text if you want to replace matches with that
$obj->startSearching($path);//starting search
$obj->showLog();//showing log
$obj->writeLogToFile($logFile); //writting result to log file