Thursday, September 8, 2011

Control Statements, Operators and Related topics in Internet


Control structures change the flow of execution in a script. If and switch statement are used to choose to between different blocks of code to execute. The same block of code can be repeated multiple times with for, for each, while, do loop, break, continue, exit () and die () stop the execution of a script or block of code. Finally, include and require functions provide a way for PHP scripts to call other PHP scripts.
Conditional statements:
It allows to branch of the path of execution in a script based on evaluate true or false.
Athematic Operators  
The symbols operator preforms athematic calculations:
Symbol
Operator
Action
+
Addition
5+6 return 11
-
Subtraction
6-3 return 3
*
Multiplication
6*3 returns 18
/
Division
6/3 returns 2
%
Module(remainder)
7%2 returns 1

Assignment Operator:
It assigns the value returned by an operation to the accumulator is called assignment operator.
Identifiers:
It identifies data and hold value in computers memory. We can pass different values to identifiers and set also.
Switches:
It is a good alternative to If/Else if/Else statement in situations where we can check multiple values against a single variable or condition.





No comments:

Post a Comment