Week 2 LecturePPT
Week 2 LecturePPT
PHP Tags
Escaping from HTML
Instruction separation
Comments
Statement
Whitespace
PHP tags
When PHP parses a file, it looks for opening and
closing tags, which are <?php ?> which tell PHP to
start and stop interpreting the code between them.
Parsing in this manner allows PHP to be embedded in
all sorts of different documents that is capable of
accommodating it, as everything outside of a pair of
opening and closing tags is ignored by the PHP parser.
Example1:
<?PHP echo “welcome to PHP class”; ?>
This will print:
welcome to PHP class
Escaping from HTML
PHP allows us to create our own customized functions called the User
Defined Functions.
Function Parameter vs. Argument
Function Parameters: these are the names listed in the definition of a
function.
Function Arguments: these are the real values that are passed when
calling a function
The end