How do I rewrite the following script so that it finds and replaces a string of text that includes the ' / ' (forward slash) character??? Here is the original script:
Code: Select all
require_once('TextSearch.class.php');
$path = "/home/hsmhost/public_html/"; //setting path to search
$logFile = "log_result.txt"; //setting log file
$obj = new TextSearch();
$obj->setExtensions(array('php')); //setting extensions to search files within
$obj->addExtension('txt');//adding an extension
$obj->setSearchKey('[color=#BF0000]/__HS0108/images/head[/color]'); //what to search for
$obj->setReplacementKey('[color=#BF0000]/images/head[/color]');//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