Lesson 4 - PHP Operators
Lesson 4 - PHP Operators
Structures
Slide 1
Objectives
• To understand the different types of operators that are
available on PHP.
• To know what is operator precedence and operator
associativity in PHP.
• To ensure that programs expression are logically correct by
using the correct referencing values of its precedence.
• To use escape sequence properly in the program.
• To know the different approach of control structures.
• To know the fundamentals syntax for conditional and
looping structures.
• To properly use the compound expression using the logical
operators.
• To know the rules of break, continue, and goto statements.
• To see some alternative enclosure for control structures.
Slide 3
Operator Precedence, Associativity, and Pupose
Beginning PHP and MySQL 3rd Edition by: W. Jason Gilmore pp.124
Slide 4
Operator Precedence
is a characteristic of operators that determines the order in which they
evaluate the operands surrounding them.
Output:
Slide 5
Operator Associativity
is a characteristic of an operator specifies how operations of the same
precedence are evaluated as they are executed.
Output:
Example:
Slide 6
Arithmetic Operator
Beginning PHP and MySQL 3rd Edition by: W. Jason Gilmore pp.124
Assignment Operator
Beginning PHP and MySQL 3rd Edition by: W. Jason Gilmore pp.126
Slide 7
Increment and Decrement Operator
Beginning PHP and MySQL 3rd Edition by: W. Jason Gilmore pp.127
Example: Output:
Slide 8
Comparison Operator
Beginning PHP and MySQL 3rd Edition by: W. Jason Gilmore pp.129
Example: Output:
Slide 9
Logical Operator
Beginning PHP and MySQL 3rd Edition by: W. Jason Gilmore pp.128
Equality Operator
Beginning PHP and MySQL 3rd Edition by: W. Jason Gilmore pp.129
Slide 10
Bitwise Operator
Beginning PHP and MySQL 3rd Edition by: W. Jason Gilmore pp.130
Example: Output:
Slide 11
Escape Sequences
Beginning PHP and MySQL 3rd Edition by: W. Jason Gilmore pp.132
Slide 12