Does PHP Code Work in HTML File?

HTML Dosyasında PHP Kodu Çalışır mı?
Merhaba Arkadaşlar, It is one of the most curious subjects of friends who are new to web software. HTML can work inside PHP Files, but will PHP Code work inside HTML Files? Apache Web Server does not run PHP in .html files unless you define it. If you want to make such a definition to Apache, you can create a .htaccess file in the root directory of the server and add the following line:
AddType application/x-httpd-php .htm .html
With this line you add to the .htaccess file, you tell Apache that you can run PHP codes in HTML files as well. Let’s try it! Open the IDE you are using.
<!DOCTYPE html>
<html>
<head>
<title>MersevBilisim Information Guides</title>
</head>
<body>
<?php
$hi = "Hello World";
echo $hi;
?>
</body>
</html>
Save as index.html and run it. It works with PHP!