Defining your own functions or constants that hold HTML data is usually the best practice.
It's considered messy coding to have all kinds of HTML intermixed with a PHP script. What I do, and I think this is the generally accepted way to do it, is separate my main PHP code from my HTML into two separate files: myScirpt.php and myFunctions.php .
That way, I can require_once() the myFunctions script into myScript, and have all of the HTML functions I defined available to me without muddying up the actual PHP code with a bunch of HTML.
EDIT: In drew's example, there is a minor error (minor meaning it was simply an "Oops! I forgot!" error), as this:
function html_footer()
{
echo <<<EOD
...
</html>
}
function login_form()
{
should be this:
function html_footer()
{
echo <<<EOD
...
</html>
EOD;
}
function login_form()
{
(I know it was a quick example, drew, but I just wanted to make sure you and, more importantly, DisGirl, were aware that it was a simple typo, not intentional.)