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]); 
    }
?>
  • (A) Bale
  • (B) AshleyShrek
  • (C) BaleBlank
  • (D) AshleyBaleBlank
πŸ’¬ Discuss
βœ… Correct Answer: (D) AshleyBaleBlank

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
135475
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Yogesh
Publisher
πŸ“ˆ
83%
Success Rate