Line 1
Since php can be, and often is embeded into plain html, you need
a way to tell the php parser what parts of your text file is
php code that needs to be processed.
You do that by using the <?php opening tag.
Line 2
The way you send stuff to the browser with php is by using the "echo"
command.
This line echos some text to the browser.
Any text that you send to the browser with the "echo" command should be
enclosed in single or double quotes. Both of these type of quotes
should share the same key on your keyboard.
The php parser has to know where the text starts and ends, so you need
to put it in quotes. And also since it uses these quotes to determine
where your text begins and ends, you need to make sure that the
type of quote you use doesn't actually appear in the text.
Example of the wrong way:
<?php
echo "Ed said, "I think php is cool". I think so too.";
?>
This will cause an error.
You have to choices. You can either put the entire text in single quotes('),
or you can escape the quotes used in the text.
Examples of the right way:
<?php
echo "Ed said, \"I think php is cool\". I think so too.";
?>
or
<?php
echo 'Ed said, "I think php is cool". I think so too.';
?>
When you put an escape character( \ ) in front of something it tells
the program to treat it as regular text and not as having any special meaning to the program.
The other thing to point out is that you always need to put
a semi-colon at the end of your echo statement.
Without the semi-colon, you'll get an error.
Line 3
This closes php and goes back to html mode. Every opening php tag
should have a corresponding closing tag.