Hello,
I am having trouble searching for a regular expression in a file string.
i am trying to search for
define('TITLE','My Web Site');
and replace it with
define('TITLE','$title2');
where title2 is a form field
This line doesnt find the reg exp im looking for
ereg_replace("define('TITLE','[']');",$replacement,$file);
<?php
$fle=fopen("catalog/includes/languages/english.php",r);
$file=fread($fle,5000000000);
$replacement="define('TITLE', $title2)";
$newfile=ereg_replace("define('TITLE','[']')",$replacement,$file);
fclose($fle);
$fp=fopen("catalog/includes/languages/english.php",w);
if(fwrite($fp,$newfile,strlen($newfile))){
echo "good";
}
else{
echo "bad";
}
fclose($fp);
?>
Thanks in advance for your help.
Abe