πŸ“Š PHP
Q. Which of the following is the correct way to add a comment in PHP code?
  • (A) #
  • (B) //
  • (C) /* */
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned
πŸ“Š PHP
Q. Which of the following is the default file extension of PHP files?
  • (A) .php
  • (B) .ph
  • (C) .xml
  • (D) .html
πŸ’¬ Discuss
βœ… Correct Answer: (A) .php
πŸ“Š PHP
Q. What will be the output of the following PHP code?
Code:
<?php
$x = 10;
$y = 20;
if ($x > $y && 1||1)
    print "1000 PHP MCQ" ;
else
    print "Welcome to McqBuddy";
?>
  • (A) no output
  • (B) Welcome to McqBuddy
  • (C) 1000 PHP MCQ
  • (D) error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 1000 PHP MCQ
πŸ“Š PHP
Q. Which is the right way of declaring a variable in PHP?
  • (A) $3hello
  • (B) $_hello
  • (C) $this
  • (D) $5_Hello
πŸ’¬ Discuss
βœ… Correct Answer: (B) $_hello
πŸ“Š PHP
Q. What will be the output of the following PHP program?
Code:
<?php
$fruits = array ("apple", "orange", array ("pear", "mango"),"banana");
echo (count($fruits, 1));
?>
  • (A) 6
  • (B) 5
  • (C) 4
  • (D) 3
πŸ’¬ Discuss
βœ… Correct Answer: (A) 6
πŸ“Š PHP
Q. What will be the output of the following PHP program?
Code:
<?php
    function multi($num)
    {
        if ($num == 3)
            echo "I Wonder";
        if ($num == 7)
            echo "Which One";
        if ($num == 8)
            echo "Is The";
        if ($num == 19)
            echo "Correct Answer";
    }
    $can = stripos("I love php, I love php too!","PHP");
    multi($can);
?>
  • (A) Correct Answer
  • (B) Is The
  • (C) I Wonder
  • (D) Which One
πŸ’¬ Discuss
βœ… Correct Answer: (D) Which One
πŸ“Š PHP
Q. A------is a platform to create PHP web applications
  • (A) php framework
  • (B) ORM
  • (C) phplib
  • (D) command link interface
πŸ’¬ Discuss
βœ… Correct Answer: (A) php framework
πŸ“Š PHP
Q. --------is a method of accessing database data using object-oriented
syntax instead of using SQL
  • (A) php framework
  • (B) ORM
  • (C) phplib
  • (D) command link interface
πŸ’¬ Discuss
βœ… Correct Answer: (B) ORM
πŸ“Š PHP
Q. (ORM)means ----------l
  • (A) Object-Relational Mapping
  • (B) object random map
  • (C) Model View Controller
  • (D) command link interface
πŸ’¬ Discuss
βœ… Correct Answer: (A) Object-Relational Mapping
πŸ“Š PHP
Q. PHP frameworks typically follow the---------design pattern. This concept separates the manipulation of data from its presentation.
  • (A) Object-Relational Mapping
  • (B) object random map
  • (C) Model View Controller
  • (D) command link interface
πŸ’¬ Discuss
βœ… Correct Answer: (C) Model View Controller