πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
<?php
echo "Hello MCQ Buddy";
?>
?>
  • (A) Nothing
  • (B) Hello
  • (C) Error
  • (D) Hello MCQ Buddy
πŸ’¬ Discuss
βœ… Correct Answer: (C) Error
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
echo "echo "Hello MCQ Buddy"";
?>
  • (A) Error
  • (B) Hello MCQ Buddy
  • (C) echo "Hello MCQ Buddy"
  • (D) echo Hello MCQ Buddy
πŸ’¬ Discuss
βœ… Correct Answer: (A) Error
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
echo "Hello MCQ Buddy"
?>
  • (A) Hello MCQ Buddy
  • (B) Error
  • (C) Nothing
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) Hello MCQ Buddy
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
 # echo "Hello MCQ Buddy";
 echo "# Hello MCQ Buddy"; 
?>
  • (A) Hello MCQ Buddy
  • (B) Error
  • (C) Hello MCQ Buddy # Hello MCQ Buddy
  • (D) # Hello MCQ Buddy
πŸ’¬ Discuss
βœ… Correct Answer: (D) # Hello MCQ Buddy
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
$country = "India";
echo "$country";
echo "$COUNTRY";
echo "$Country";
?
  • (A) Error
  • (B) India
  • (C) IndiaIndiaIndia
  • (D) IndiaIndia
πŸ’¬ Discuss
βœ… Correct Answer: (B) India
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
Echo "Hello
";
echo "MCQ
";
ECHO "Buddy";
?>
  • (A) Hello
  • (B) MCQ
  • (C) Buddy
  • (D) Hello MCQ Buddy
πŸ’¬ Discuss
βœ… Correct Answer: (D) Hello MCQ Buddy
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
print_r "Hello MCQ Buddy"
?>
  • (A) Hello MCQ Buddy
  • (B) Missing semicolon error
  • (C) Error
  • (D) Nothing
πŸ’¬ Discuss
βœ… Correct Answer: (C) Error
πŸ“Š PHP
Q. What will be the output of the following PHP code ?
Code:
<?php
"Hello MCQ Buddy"
?>
  • (A) Nothing
  • (B) Hello MCQ Buddy
  • (C) Missing semicolon error
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) Nothing
πŸ“Š PHP
Q. How to define a function in PHP?
  • (A) functionName(parameters) {function body}
  • (B) function {function body}
  • (C) function functionName(parameters) {function body}
  • (D) data type functionName(parameters) {function body}
πŸ’¬ Discuss
βœ… Correct Answer: (C) function functionName(parameters) {function body}
πŸ“Š PHP
Q. What will be the output of the following PHP code?
Code:
<?php
$x = 10;
$y = 20;
if ($x > $y && 1||1)
    print "PHP MCQ" ;
else
    print "Welcome to MCQ Buddy";
?>
  • (A) no output
  • (B) Welcome to MCQ Buddy
  • (C) PHP MCQ
  • (D) error
πŸ’¬ Discuss
βœ… Correct Answer: (C) PHP MCQ