Ok, my parsing basically looks like this:
$layoutpage = implode('', file("layout.html"));
$layoutpage = str_replace( "!--%LeftBlock%-->",
"<?php left(); ?>", $layoutpage);
$layoutpage = addslashes( $layoutpage );
$layoutpage = "\$result=\"".$layoutpage."\";";
eval($layoutpage);
echo($result);
and my html looks like:
<table width=$width height=$height border=0 valign="top">
<tbody>
<tr>
<td style="vertical-align: top;" rowspan="1" colspan="3"><!--%TagToReplace%--></td>
</tr>
.
.
.
and i get this as a result:
<table width=955 height=640 border=0 valign="top">
<tbody>
<tr>
<td style="vertical-align: top;" rowspan="1" colspan="3"><?php left(); ?></td>
</tr>
.. Hope this makes sense.