PHP MCQ Questions and Answers

Practice Mode
Showing 10 of 130 questions
Q21
When compared to the compiled program, scripts run
  • A Faster
  • B Slower
  • C The execution speed is similar
  • D All of above
Answer: Option B
Q22
PHP is a widely used ……………. scripting language that is especially suited for web development and can be embedded into html
  • A Open source general purpose
  • B Proprietary general purpose
  • C Open source special purpose
  • D Proprietary special purpose
Answer: Option A
Q23
Which of the following is not true?
  • A PHP can be used to develop web applications.
  • B PHP makes a website dynamic.
  • C PHP applications can not be compiled.
  • D PHP can not be embedded into html.
Answer: Option D
Q24
The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:
  • A <? ?>
  • B <script language=”php”> </script>
  • C <% %>
Answer: Option D
Q25
The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:
  • A <? ?>
  • B <script language=”php”> </script>
  • C <% %>
Answer: Option D
Q26
Which of the following variables is not a predefined variable?
  • A $get
  • B $ask
  • C $request
  • D $post
Answer: Option A
Q27
You can define a constant by using the define() function. Once a constant is defined
  • A It can never be changed or undefined
  • B It can never be changed but can be undefined
  • C It can be changed but can not be undefined
  • D It can be changed and can be undefined
Answer: Option A
Q28
The following piece of script will output: &lt;? $email=&rsquo;admin@psexam.com&rsquo;; $new=strstr($email, &lsquo;@&rsquo;Wink; print $new; ?&gt;
  • A admin
  • B admin@psexam
  • C @psexam.com
  • D psexam.com
Answer: Option C
Q29
Which of the following function returns the number of characters in a string variable?
  • A count($variable)
  • B len($variable)
  • C strcount($variable)
  • D strlen($variable)
Answer: Option D
Q30
When you need to obtain the ASCII value of a character which of the following function you apply in PHP?
  • A chr( );
  • B asc( );
  • C ord( );
  • D val( );
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test