You need to assign out to variables, so if you have:
PHP Code:
// Some PHP code here
?>
<p>Some HTML here</p>
<?php
// Some more PHP Code
?>
<p>Some more HTML here</p>
You would change it to:
PHP Code:
// Some PHP Code
$somevar = '<p>Some HTML code</p>';
// Some more PHP Code
$somevar .= '<p>Some more HTML code</p>';
(Don't for get that echo()'ing also outputs so you will to add that to the output. Note also how the period on the second assignment adds data to the end of variable.)