PHP MCQ Questions and Answers

Practice Mode
Showing 10 of 130 questions
Q91
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");
  • A may 19,09,2:45:32 PM
  • B May 19, 2009, 2:45 pm
  • C May 19,2009,14:45:32 pm
  • D May 19,2009,14:45:32 PM
Answer: Option B
Q92
Which of the following function is used for terminate the script execution in PHP?
  • A break()
  • B quit()
  • C die()
Answer: Option A
Q93
What function used to print statement in PHP?
  • A echo();
  • B printf
  • C ""
Answer: Option A
Q94
<?php define("x","5"); $x=x+10; echo x; ?>
  • A Error
  • B 15
  • C 10
  • D 5
Answer: Option A
Q95
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); ?>
  • A 42
  • B 56
  • C Null
  • D x=42
Answer: Option B
Q96
PHP variables are
  • A Multitype variables
  • B Double type variables
  • C Single type variable
  • D Trible type variables
Answer: Option A
Q97
Which of these statements is true?
  • A 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.
  • B 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.
  • C PHP interfaces to a number of relational databases such as MySQL, Oracle and Sybase but the interface differs in each case.
  • D 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.
Answer: Option C
Q98
Is php can support multiple inheritance?
  • A NO
  • B YES
Answer: Option A
Q99
How would you add 1 to the variable $count?
  • A incr count;
  • B $count++;
  • C $count =+1
  • D incr $count;
Answer: Option B
Q100
Which of the following is used to check if a function has already been defined?
  • A bool function_exists(functionname)
  • B bool f_exists(functionname)
  • C bool func_exist(functioname)
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test