PHP Echo, the relation between php and html

Echo is the most used php function to make php interact with html. In fact, echo is used to write some text into a html page, or may be in a text file, or any file that contain text.

<?php
echo "wellcome !";
?>
Display:
Wellcome !
And in html:

<html>
<head>
<title>My Page Title here</title>
</head>
<body>
<?php
echo "Hello World ! ";
?>
</body>
</html>
Display:

<html>
<head>
<title>My Page Title here</title>
</head>
<body>
Hello World !
</body>
</html>
Echo and variables
You can echo both variables or directly a text, this example will show you how:

Output a variable:
<?php
$myvar = "Wellcome !";
echo $myvar;
?>
display
Wellcome !


Output directly a text:
<?php
echo "Wellcome !";
?>
Display
Wellcome !

As you see, we have the same displaying text, no difference between putting a text or a variable.

What type of variables can I echo ?
Again, in php there are no types of variables, you can output anythings, strings, numbers, arrays ...
PHP will convert automatically numbers and other type to text so they can be displayed in html pages.