Indenting your PHP
As with HTML, CSS and JavaScript it pays to indent code. How you do this is up to you but these tutorials tend to just indent the code within the HTML as if it was more HTML elements (see the samples so far). That can result in a lot of indenting but it does work.
Proper layout for ECHOed HTML
The real problem is that when you ECHO HTML to a Web page PHP does not format the output nicely. Open firstphppage.php (you created this in the Beginners PHP tutorial) in a browser and look at the source HTML. HTML generated by PHP can look horrible because the browser ignores tabs and extra spaces as well as line breaks so all the code ends up one one line crammed together.
You can amend the PHP code in firstphppage.php so that one of the ECHO lines of code looks like this (or just add something like this to any PHP/HTML page):
echo "\n<p>The total is $total</p>\n";
The extra bits are the codes which Unix/Linux uses to show the presence of a new line (like pressing the Enter key). For Windows servers you may need to use \r\n.
Upload and view the source in the browser. You should find that this line now appears separate from the lines before and after. Do the same for all of the other lines. Note that the extra layout in the HTML code does not affect what the user sees on the finished Web page.
Tabs
You can also insert tabs in the same way but you may decide it is a lot of bother. If you don't care what people will see if they look at your HTML source then the only other reason to include tabs is to help you to spot problems with the ECHOed HTML. This troubleshooting is enough reason on it's own so at least try this:
echo "\n\t<p>The total is $total</p>\n";




