The echo() construct:
echo() is also equal to print(). What echo does is that it outputs anything you put into it. For instance, you can put PHP and HTML in the echo statement and it will parse both the html string and the php code. There is a few things to remember when using an echo statement. Using single quotes or double quotes does not matter. However, if you use double quotes and then you use HTML that has some double quotes in it you'll get an error. If you do it this way you have to escape the extra double quotes. I'll give a couple of examples so that it will make these things clear.
Example #1:
echo('<p>This is an html paragraph</p>');Outputs - This is an html paragraph
Notice the parenthesis (). They are not required. However, the use of a single quote or the double quote is required if your outputting HTML or text. Also, you MUST end an echo statement with a semi-colon. This tells php that your echo statement is finished.
Example #2:
echo'<div>Some html</div>', strtolower('TRANSFORM ME TO LOWER TEXT'), '<hr />';Outputs - Some html transform me to lower text
Notice I have mixed html and PHP here. Anytime you mix php/html you have to escape to PHP. You do this by using
',You also have to escape back to html if you use html after the php. You'll notice I also do that by reversing the order of the escape like this
,'The strtolower (string to lower), transforms what ever string you put into it to all lower case.
Example #3:
echo"<table align=\"center\"></table>";Notice how I escaped the extra double quotes in the HTML. This is the reason I prefer to use single quotes. You can do the same thing without escaping.

But the same rules apply, if you have extra single quotes you'll have to escape them as well.
Example #4:
$mystring = 'This is my string that I have assigned to the mystring variable';
echo $mystring;Outputs - This is my string that I have assigned to the mystring variable
Here I have assigned the string to a variable and then echo'd the variable. Whenever you're echoing ONLY php the quotes aren't required, but of course the semi-colon is.

I think I'll add more to this if any questions arise, or if I have forgotten something.

Feel free to post your thoughts if you have any.