Escaping tags will work too:
Code:
<?php
if ($var == true) {
?>
<html>
blah blah blah
<? php
}
?>
You can also include php files that have no php tags at all. This is helpful if you have something that is the same on every single page, like a header or footer:
Code:
header.php
<div id="header>
This is my header
</div>
index.php
<?php
include("header.php");
?>
This will output the contents of header.php as soon as the file is included.
One more thing you can do is use double quotes, as double quotes keep newline and tab characters intact, whereas single quotes ignore these:
Code:
<?php
echo "<html>
this is my code blah blah
blah
blah
blah
etc";