PHP Basic Syntax
Submitted by Yorkiebar on Friday, December 27, 2013 - 08:16.
Introduction:
This tutorial will cover the basic syntax of PHP files.
What is syntax?
Syntax is defined as "the structure of statements in a computer language." and as such refers to the format of the given scripts.
Importance of correct syntax
Having correct syntax in any script is extremely important. If a script has just one syntax error it could produce a lot of further problems and cause a fair bit of damage.
Line Terminators
A line terminator is a character which is used to signify the end of a scripting line - this excludes blank lines, comments, method/function starting lines, and lines only consisting of curly braces. In PHP the line terminator is a semi-colon (;).
PHP Placement
Any PHP scripting must be placed between PHP tags - the ending tag is "?>" while the starting tag can be "Examples/Samples:
PHP Tags:
Starting:
Starting #2:
Ending:
Line Terminator:
- <?php
- <?
- ?>
- ;
Add new comment
- 11 views