PHP MCQ Question and Answer

PHP MCQ Question and Answer
91. what will be the ouput of below code ? Assume that today is 2009-5-19:2:45:32 pm

<?php

$today = date("F j, Y, g:i a");

  • may 19,09,2:45:32 PM
  • May 19, 2009, 2:45 pm
  • May 19,2009,14:45:32 pm
  • May 19,2009,14:45:32 PM
Show Answer
92. Which of the following function is used for terminate the script execution in PHP?
  • break()
  • quit()
  • die()
Show Answer
93. What function used to print statement in PHP?
  • echo();
  • printf
  • ""
Show Answer
94. <?php
define("x","5");
$x=x+10;
echo x;
?>
  • Error
  • 15
  • 10
  • 5
Show Answer
95. what will be the output of below code ?
<?php
$arr = array(5 => 1, 12 => 2);
$arr[] = 56;
$arr["x"] = 42;
unset($arr);
echo var_dump($arr);

?>
  • 42
  • 56
  • Null
  • x=42
Show Answer
96. PHP variables are
  • Multitype variables
  • Double type variables
  • Single type variable
  • Trible type variables
Show Answer
97. Which of these statements is true?
  • PHP interfaces to the MySQL database,and you should transfer any data in Oracle or Sybase to MySQL if you want to use PHP on the data.
  • PHP interfaces to a number of relational databases such as MySQL, Oracle and Sybase. A wrapper layer is provided so that code written for one database can easily be transferred to another if you later switch your database engine.
  • PHP interfaces to a number of relational databases such as MySQL, Oracle and Sybase but the interface differs in each case.
  • There's little code in PHP to help you interface to databases, but there's no reason why you can't write such code if you want to.
Show Answer
98. Is php can support multiple inheritance?
  • NO
  • YES
Show Answer
99. How would you add 1 to the variable $count?
  • incr count;
  • $count++;
  • $count =+1
  • incr $count;
Show Answer
100. Which of the following is used to check if a function has already been defined?
  • bool function_exists(functionname)
  • bool f_exists(functionname)
  • bool func_exist(functioname)
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test