eval()
Posted: Mon Feb 21, 2005 9:20 pm
I'm trying to send some html with PHP vars in it through eval(). I'm totally lost in the world of escaped/not escaped. I'm sooo confused. Not many examples of this in the PHP manual. Can someone lend me a hand:
Any tips you can post about eval() in general would be helpful. I mean I understand it accepts a string and evaluates it has code. But '"'"/"/" sort of thing gets confusing.
Thanks
Code: Select all
if (file_exists(RF_HTML.$header))
{
$html_header = file_get_contents(RF_HTML.$header);
$year = date('Y', time());
define('SERVERNAME', 'THIS SERVER');
eval("$html_header = $html_header;");
return $html_header;
}
//The file called with file_get_contents() has this in it:
</td>
<td width="146" valign="top" class="small">
</td>
</tr>
<tr>
<td class="small">© '.$year.' '.SITENAME.' </td>
<td>
</td>
<td> </td>
</tr>
</table>Thanks