Y
Q. What will be the output of the following PHP code?
Code:
<?php
$user = array("Ashley", "Bale", "Shrek", "Blank");
for ($x=0; $x < count($user) - 1; $x++)
{
if ($user[$x++] == "Shrek")
continue;
printf ($user[$x]);
}
?>
$user = array("Ashley", "Bale", "Shrek", "Blank");
for ($x=0; $x < count($user) - 1; $x++)
{
if ($user[$x++] == "Shrek")
continue;
printf ($user[$x]);
}
?>
- Correct Answer - Option(D)
- Views: 15518
- Filed under category PHP
Discusssion
Login to discuss.