--- whoisquilty <[EMAIL PROTECTED]> wrote:

> I want to set a variable that will include HTML code and MySQL query results.
> Is this possible?

Yes.  Instead of using print or echo simply build up a big variable.  This can
contain any variables or dynamic content you desire.

$out = "";
$out .= "first line<br />\n";
$out .= "second line<br />\n";

To send the output to the browser simply:

print $out;

You can also play games with output buffering -- ob_*() functions -- but these
require that your opening PHP tag be on the first line, first character
position.  I don't think it will work if you start to send output to the
browser.  It may not be as picky as header(), set_cookie(), etc. which write to
the HTTP headers.

James

Reply via email to