okay, i have a function to read html files, addslashes to them, and then parse them to add in variables. the function looks like this:
function readFile($file, $slash)
{
$open = fopen($file, "r");
$string = fread($open, filesize($file));
fclose($open);
if($slash)
$string = addslashes($string);
return $string;
}
so i read a file, then parse it using eval() like so:
eval("\$content = \"$string\";");
this works fine, but now i want to add some php to the top of the file i read into the script. this causes errors, and i am not sure how to write it so it works. any ideas to help me in the right direction?
thanks in advance.
chris