like I said, any parsing-based system is going to be less efficient than organizing things to be done the way you want in the first place. Instead of using keywords, this approach might be better:
PHP Code:
$HEADER = func_builds_header();
$MENU = func_builds_menu();
$ETC = and_so_forth();
$template = '
<!doctype html>
<html>
<head><meta charset="utf-8"><title>Page template</title></head>
<body>
<div id="header">'. $HEADER .'</div>
<div id="formatting_wrapper">
<div id="menu">'. $MENU .'</div>
<div id="etc">'. $ETC .'</div>
</div>
</body>
';
print $template;
you could also simply include() the template file after all your content has been generated.
Bookmarks