I would like to make a multi line variable, that is to say, I would like to imitate something an if statement can do

With an if statement you can do this:
PHP Code:
if ($var == 1) { ?>
Html code here
can be as long
or as short as you like
blah blah blah more html
<?php ?>
and that will work fine, what I would like to do is something similar with a variable so far I came up with this
PHP Code:
<?php $var ' ?>
HTML code here
<?php '
The problem with the above is that when you echo that statement, it will echo the "?>" as well. Is there a way around this???