nice hack, I fixed it slightly though to suit my needs:
PHP Code:
if (substr_count($template,'?'.'>')>=1 or substr_count($template,'php?'.'>')>=1 or substr_count($template,'</php>')>=1) {
while (preg_match("/(\<\?php|\<\?|\<php\>)(\r\n)*(.*)(\r\n)*(php\?"."\>|\?"."\>|\<\/php\>)/siU", $template, $matches)) {
if ($parse_phpcode) {
preg_match_all("/\\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/", $matches[3], $varnames);
$varnames = implode(", ", $varnames[0]);
if (!empty($varnames)) {
@eval("global $varnames;");
}
$eval_result = @eval(stripslashes($matches[3]));
} else $eval_result = "";
$template = str_replace($matches[0], $eval_result, $template);
}
}
You can now use:
<? ?>
<?php php?>
<php></php>
and any combinations of them, such as:
<?php ?>
and so on.
Also now if you use return(stuff here); in the php script, it returns the data straight to the template itself. Like:
<?
$stuff = "stuff";
return $stuff;
?>
would return the $stuff varible right into the template for you.