Control Statements in PHP
Notes:
PHP Control Statements
- are statements; which help us to get the control over flow of execution of a code.
3 types of control statements:
1. Conditional / selection:
- help us to execute set of statements based on the result of a condition
if,
if else,
else if ladder,
switch case
2. Looping / Iterative:
- help us to execute set of statements repeatedly
for,
while,
do while,
foreach as
3. Jumping / control transfer:
- help us to transfer the control from one place to another place directly
break,
continue,
goto,
function call,
return
Interview Questions:
1. PHP stands for ______________
a. Hypertext Preprocessor
b. Preprocessor Hypertext
c. Personal Home Processor
d. Personal Hypertext processor
Ans: a