Home / Programming Questions / PHP MCQs / Page 3
Dear candidates you will find MCQ questions of PHP here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
S
Q. What will be the output of the following code?
<?php function track() { static $count = 0; $count++; echo $count; } track(); track(); track(); ?>
S
Q. What will be the output of the following PHP code?
<?php $a = "clue"; $a .= "get"; echo "$a"; ?>
S
Q. What will be the output of the following PHP code?
<?php $a = 5; $b = 5; span class="sys-fun">echo ($a === $b); ?>
S
Q. Which of the below symbols is a newline character?
S
Q. Which of the conditional statements is/are supported by PHP? 1. if statements 2. if-else statements 3. if-elseif statements 4. switch statements
S
Q. What will be the output of the following PHP code?
<?php $team = "arsenal"; switch ($team) { case "manu": echo "I love man u"; case "arsenal": echo "I love arsenal"; case "manc": echo "I love manc"; } ?>
S
Q. Which of the looping statements is/are supported by PHP? 1. for loop 2. while loop 3. do-while loop 4. foreach loop
S
Q. 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]); } ?>
Don't have account? Register here.