Examveda
Examveda

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: Option B

Solution(By Examveda Team)

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

This Question Belongs to PHP >> Basic PHP

Join The Discussion

Related Questions on Basic PHP