CIST2351-PHP Programming I - Ch 08
What does $message contain after the following code executes? $statusCode = "403"; switch ($statusCode) { case "200": $message = "OK"; break: case "403": $message = "Forbidden"; break: case "404": $message = "Not Found"; break: default: $message = "Unknown Status"; break:
Forbidden
What does $message contain after the following code executes? $message = "L: "; for ($i = 0: $i < 10; $i++) $message .= $i . ", "; if (i == 7) break;
L: 0, 1, 2 ,3 ,4 ,5, 6, 7,
Which of the following statements will restart the execution of a loop?
continue
Which type of statement ends the current iteration of a loop?
continue
Which type of loop will always execute its code at least once?
do-while
A switch statement in PHP starts by evaluating a switch _____ .
expression
An if statement can be used to implement a _____ structure.
selection
How many operands does a ternary operator have?
3
Which of the following can be used in a conditional expression?
all of these
While loops and for loops are often referred to as _____ structures.
iteration