Another approach is put the HTML in a separate file and mark the area to change with a placeholder [[content]] in this case. (You can also use sprintf instead of the str_replace.)
$page = 'hello world';
$content = file_get_contents('html/welcome.html');
$pagecontent = str_replace('[[content]]',$content,$page);
echo($pagecontent);
Alternatively you can just output all the php stuff to the screen captured in a buffer, then write the html, then put the php output back into the page.
It might seem strange to write the php out, catch it, then write it again, but it does mean that you can do all kinds of formatting stuff (Heredocs etc),& test it outputs correctly without the hassle of the page template getting in the way. (Joomla CMS does it this way, BTW)
ie:
<?php
ob_start();
echo('hello world');
$php_output = ob_get_contents();
ob_end_clean();
?>
<h1> My Template page says </h1>
<?php
echo($php_output );
?>
<hr>
template footer