PHP MCQ Question and Answer

PHP MCQ Question and Answer
21. When compared to the compiled program, scripts run
  • Faster
  • Slower
  • The execution speed is similar
  • All of above
Show Answer
22. PHP is a widely used ……………. scripting language that is especially suited for web development and can be embedded into html
  • Open source general purpose
  • Proprietary general purpose
  • Open source special purpose
  • Proprietary special purpose
Show Answer
23. Which of the following is not true?
  • PHP can be used to develop web applications.
  • PHP makes a website dynamic.
  • PHP applications can not be compiled.
  • PHP can not be embedded into html.
Show Answer
24. The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:
  • <% %>
Show Answer
25. The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:
  • <% %>
Show Answer
26. Which of the following variables is not a predefined variable?
  • $get
  • $ask
  • $request
  • $post
Show Answer
27. You can define a constant by using the define() function. Once a constant is defined
  • It can never be changed or undefined
  • It can never be changed but can be undefined
  • It can be changed but can not be undefined
  • It can be changed and can be undefined
Show Answer
28. The following piece of script will output:
<?
$email=’admin@psexam.com’;
$new=strstr($email, ‘@’Wink;
print $new;
?>
  • admin
  • admin@psexam
  • @psexam.com
  • psexam.com
Show Answer
29. Which of the following function returns the number of characters in a string variable?
  • count($variable)
  • len($variable)
  • strcount($variable)
  • strlen($variable)
Show Answer
30. When you need to obtain the ASCII value of a character which of the following function you apply in PHP?
  • chr( );
  • asc( );
  • ord( );
  • val( );
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test