To clarify the previous two posts....
A PHP file does not need to start with HTML; you can have <?php and PHP code right from the start and all will be well.
But the output generated by the script (assuming it is generating an HTML page) and received by the client SHOULD be valid HTML; i.e., include, <html><head>...etc.
Thing to remember is that PHP doesn't care what PHP sends to the client; and the clien doesn't care how the server generated what the server sent in its response.
So if your entire PHP file was
<?php
echo '<p>It is currently';
echo date('H:i, jS F');
echo '</p>';
?>
So that the HTML the client received only said
<p>It is currently13:48 3rd March</p>
Then it means that you just sent them invalid HTML.
You could write
<?php
echo '<html><head><title>Time</title></head>';
echo '<body>';
echo '<p>It is currently ';
echo date('H:i jS F');
echo '</p>';
echo '</body></html>';
?>
So that the client received
<html><head><title>Time</title></head><body><p>It is currently 13:48 3rd March</p></body></html>