Hello,
I am trying to use preg_replace, but its not replacing anything, which i assume means the reg exp is not finding anything. Does anyone know what the correct syntax would be for this reg exp...
$replacement="define('TITLE','$title2')";
$newfile=preg_replace("/define('TITLE','.+?')/",$replacement,$file);
<?php
$file=implode("",file("catalog/includes/languages/english.php"));
$replacement="define('TITLE','$title2')";
$newfile=preg_replace("/define('TITLE','.+?')/",$replacement,$file);
$fp=fopen("catalog/includes/languages/english.php",w);
if(fwrite($fp,$newfile,strlen($newfile))){
echo "good";
}
else{
echo "bad";
}
fclose($fp);
?>
thanks,
abe