Originally posted by Cinquecento
Great - thanks a bunch you bunch,
I see in the code I was dissecting that PHP variable can be placed in the stream - how about conditional loops? Does PHP parse bits it recognises - or just variables?
Ian
I looked and looked but there does not seem to be a way to execute any code inside a heredoc construct.
So here's the kind of thing you would do:
$meta_title = dbread("meta", "title", $link);
$meta_description = dbread("meta", "description", $link);
$meta_keywords = dbread("meta", "keywords", $link);
$data = <<<QQQ
<html>
<head>
<TITLE>{$meta_title}</TITLE>
</head>
<META NAME="description" CONTENT="{$meta_description}">
<META NAME="KEYWORDS" CONTENT="{$meta_keywords}">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<body BGCOLOR="#000000" TEXT="#ffffff" LINK="#EEEE00" VLINK="#FFAA00">
QQQ;
$fp = fopen("index.htm", "w+");
fwrite($fp, $data);
fclose($fp);