Embedding PHP in HTML

Posted by tutor | Posted in PHP Tutorial | Posted on 11-12-2009-05-2008

0

PHP is almost always used with HTML. PHP scripts are embedded inside HTML pages anywhere in the body section.

A simple HTML page with PHP scripts looks like this:

<html>
<head>
<title> Embedding PHP in HTML</title>
</head>
<body>
<?php
echo ”It’s so good to be here!!!”;
?>
</body>
</html>
Output:

It’s so good to be here!!!

Echo is a PHP command to output string on the web page.
Echo is a vast topic so we will be discussing it later in this tutorial.

The Semicolon

Each line of PHP code ends with a semicolon. Semicolon is the PHP delimiter.

PHP will show an error if the semicolon is missed in any line.

echo ”It’s so good to be here!!!”;