define("C_JOUEUR", "blablabla1");
define("C_GARDERUNOEIL","blablabla2");
$error = "There was a catastrophic error!";
$fcontents =
"<?php echo C_GARDERUNOEIL ?>
</td>
</tr>
<tr>
<td class=boldRed align=center colspan=2>
<?php echo $error ?>
<br><br>
</td>
</tr>
<tr>
<td width=\"45%\" class=smallBold align=right>
<?php echo C_JOUEUR ?> 1.
";
$fcontents = preg_replace("/(C_[A-Z]+)/e", "'\"' . \1 . '\"'", $fcontents);
echo "<pre>";
echo htmlspecialchars($fcontents);
This is a better way to read the file in.
$fichier="file_to_change.php";
$fp = fopen($fichier,"r");
$fcontents = fread($fp, filesize($fichier));
fclose($fp);