I wanted to get everyone's ideas on the best way to write out HTML while using PHP. The first approach is to break out of the PHP parser and print it like...
<?php
if (isset($var)) {
echo variable is set
} else {
?>
<div id="html stuff"></div>
<?php
}
or by stating the html code within a print call like...
print '<div id="html stuff"></div>'."\r";
The advantage of the first is better tab spacing and legibility but it seems almost insecure to keep html tags outside of PHP's domain (especially secured forms and hidden fields.) The second one seems to address this but can get cumbersome when you are concerned with detail.
What is everyone's method that they use to express HTML?