I have a simple application based on the php pear class SearchReplace:
// Define result of Activate click
if (isset($_POST['action']) and $_POST['action'] == 'Activate')
{
include "$docRoot/includes/pear/SearchReplace.php" ;
$files = array( "$docRoot/promotions/index.php" ) ;
$snr = new File_SearchReplace( '$promoChange = "";', '$promoChange = "'.$currentYear.'/'.$currentPromotion.'";', $files) ;
$snr -> doSearch() ;
}
Notice the string that it is configured to search for:
$promoChange = "";
What I need to do, is replace this string, when there is a varying value assigned to the variable $promoChange So basically, what I am trying to replace would look something like this:
$promoChange = "2011/sep-oct";
I would need something along the lines of:
$promoChange = "%";
What would be the correct way of doing this?
If anyone has any input in this matter, it would be appreciated greatly,
Thank You!