Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following PHP code?
<?php
$user = array(“Ashley”, “Bale”, “Shrek”, “Blank”);
for ($x=0; $x < count($user); $x++) {
if ($user[$x] == “Shrek”) continue;
printf ($user[$x]);
}
?>

What will be the output of the following PHP code?
<?php
$user = array(“Ashley”, “Bale”, “Shrek”, “Blank”);
for ($x=0; $x < count($user); $x++) {
if ($user[$x] == “Shrek”) continue;
printf ($user[$x]);
}
?>
a) AshleyBale
b) AshleyBaleBlank
c) ShrekBlank
d) Shrek

Answer: b
Explanation: The continue statement causes execution of the current loop iteration to end and commence at the beginning of the next iteration.

Join The Discussion