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
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
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.
24. The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:
- ?>
- <% %>
25. The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:
- ?>
- <% %>
26. Which of the following variables is not a predefined variable?
- $get
- $ask
- $request
- $post
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
28. The following piece of script will output:
<?
$email=’admin@psexam.com’;
$new=strstr($email, ‘@’Wink;
print $new;
?>
<?
$email=’admin@psexam.com’;
$new=strstr($email, ‘@’Wink;
print $new;
?>
- admin
- admin@psexam
- @psexam.com
- psexam.com
29. Which of the following function returns the number of characters in a string variable?
- count($variable)
- len($variable)
- strcount($variable)
- strlen($variable)
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( );