Why does PHP code not work when combined with HTML in a .htm file?

PHP code does not work when combined with HTML in a .htm file because the server does not parse PHP code within .htm files by default. To solve this issue, you can either rename the file to have a .php extension or configure your server to parse PHP code within .htm files.

// Example PHP code within a .php file
<?php
echo "Hello, World!";
?>