The basic outline of a PHP script consists of:
- PHP Opening tag
- PHP Closing tag
- File name ends .php
<?php //The infamous "Hello, World!" echo("Hello, World! \n") ; ?>
PHP tag, informs interpreter to execute PHP code
Short codes <? ?> (without the php) can be used but are considered bad form
Use # or // for a single line
Use /* for
In this case the echo() function outputs a quoted string (as its argument) within its parentheses.
NOTE: Each statement must end with a semi-colon ;
Forgetting the semi-colon, is one of the most common problems!!
Whitespace, to make code more readable