PHP Control Structures (Loop) What will be the output of the following PHP code ?$a = "2";switch ($a) {case 1:print "hi";case 2:print "hello";break;default:print "hi1";} hi1 hihi1 hihellohi1 hello hi1 hihi1 hihellohi1 hello ANSWER DOWNLOAD EXAMIANS APP
PHP Control Structures (Loop) What will be the output of the following PHP code ?$i = "";while ($i) {print "hi";}while($i < 8)$i++;print "hello"; Hi is printed once, hello 7 times Hi is printed once, hello 7 times and then hi 2 times Hi is printed 8 times, hello 7 times and then hi 2 times Hi is printed 10 times, hello 7 times Hi is printed once, hello 7 times Hi is printed once, hello 7 times and then hi 2 times Hi is printed 8 times, hello 7 times and then hi 2 times Hi is printed 10 times, hello 7 times ANSWER DOWNLOAD EXAMIANS APP
PHP Control Structures (Loop) What will be the output of the following PHP code ?$a = array("hi", "hello", "bye");foreach ($a as $value) {if (count($a) == 2)print $value;} no output infinite loop hihellobye hihello no output infinite loop hihellobye hihello ANSWER DOWNLOAD EXAMIANS APP
PHP Control Structures (Loop) What will be the output of the following PHP code ?$user = array("Ashley", "Bale", "Shrek", "Blank");for ($x = 0; $x < count($user); $x++) {if ($user[$x] == "Shrek")continue;printf ($user[$x]);} AshleyBaleBlank No output AshleyBaleShrek AshleyBale AshleyBaleBlank No output AshleyBaleShrek AshleyBale ANSWER DOWNLOAD EXAMIANS APP
PHP Control Structures (Loop) What will be the output of the following PHP code ?for ($i = 0; $i < 5; $i++) {for ($j = $i;$j > $i; $i--)print $i;} 0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 no output infinite loop 0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 no output infinite loop ANSWER DOWNLOAD EXAMIANS APP
PHP Control Structures (Loop) What will be the output of the following PHP code ?$user = array("Ashley", "Bale", "Shrek", "Blank");for ($x=0; $x < count($user) - 1; $x++) {if ($user[$x++] == "Shrek")continue;printf ($user[$x]);} Bale BaleBlank AshleyShrek AshleyBaleBlank Bale BaleBlank AshleyShrek AshleyBaleBlank ANSWER DOWNLOAD EXAMIANS APP