PHP MCQ Questions and Answers
PHP MCQ Questions with Answers help candidates strengthen their programming fundamentals and web development logic through objective-style practice. These PHP programming questions and answers are essential for cracking technical interviews and online coding assessments conducted by top recruiters like TCS, Infosys, Cognizant, and Wipro. Each question tests key PHP concepts such as syntax, data types, arrays, functions, form handling, and error management. Practicing these programming MCQs not only enhances problem-solving speed but also builds confidence for real-time technical evaluations. Whether you are preparing for placement drives, semester exams, or web development roles, this PHP MCQ collection with explanations and solutions PDF will help you master PHP efficiently. Begin your programming test practice online now and ace your upcoming PHP interview round.
PHP MCQ
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
92. Which of the following function is used for terminate the script execution in PHP?
- break()
- quit()
- die()
94. <?php define("x","5"); $x=x+10; echo x; ?>
- Error
- 15
- 10
- 5
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
96. PHP variables are
- Multitype variables
- Double type variables
- Single type variable
- Trible type variables
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.
99. How would you add 1 to the variable $count?
- incr count;
- $count++;
- $count =+1
- incr $count;
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)