Mikaela, imagine that you have a file named index.html
with the content described below:
<!DOCTYPE html>
<html>
<head>
<title>Aprendendo HTML e PHP</title>
</head>
<body>
<p>Prazer, me chamo Godfrey the King.</p>
</body>
</html>
You, as a curious person, decided to change the extension to .php
.
When you open the page in your browser - remembering that you need to have a web server installed on your computer, which is easily installed using XAMPP, WAMP, EasyPHP, among others. - the following will appear: phrase:
"Prazer, me chamo Godfrey the King."
If you change the code a bit, to:
<!DOCTYPE html>
<html>
<head>
<title>Aprendendo HTML e PHP</title>
</head>
<body>
<?php $nome = "Mikaela"; ?>
<p>Prazer, me chamo <?php echo $nome; ?>.</p>
</body>
</html>
The phrase will be replaced by: "Prazer, me chamo Mikaela.".
Now do a little test and change the file extension to .html
again and reload the page.
Did you notice the difference?
HTML is a markup language used in the construction of pages in the
Web. HTML documents can be interpreted by browsers .
PHP is a free interpreted language, originally used only
for the development of present and active applications on the
server. PHP scripts are interpreted on the server side .