PHP code sits inside a page with the HTML, as with HTML it is made up of plain-text. Therefore, a page that shows "We are about to learn some awesome PHP skillz (yes, skills with a z)" would be inside an HTML page named filename.php like this:
<html>
<head>
<title>Bright Hub Article</title>
</head>
<body> <p>That is some simple PHP code below:</p>
<?php
echo 'Hi, my name is Josef';
?>
</body>
</html>
See? The HTML is rendered as HTML and the code between the <?php and ?> gets executed as PHP.
You may notice some instances where the "php" after the question mark is missing. This is a lazy practice known as "PHP short tags" - full tags should always be used! Also, PHP statements end in a semi-colon, however, a semi-colon is not required to terminate the last line of a PHP block, as the PHP closing tag ?> contains a semi-colon.