PS Exam

  • Full Screen
  • Wide Screen
  • Narrow Screen
  • Increase font size
  • Default font size
  • Decrease font size

PHP - Multiple Choice Questions (MCQs) - Objective Questions Set 2

E-mail Print PDF

Following are the Multiple Choice Questions (MCQs) or Objective Questions from PHP (PHP: Hypertext Preprocessor)

Set - 2

 This set contains 20 objective questions with 4 options each. The correct answer is provided at the end of the page.

1. In mail($param2, $param2, $param3, $param4), the $param2 contains:
a.       The message
b.      The recipient
c.       The header
d.      The subject 
 

2. mysql_connect( ) does not take following parameter
a.       database host
b.      user ID
c.       password
d.      database name
 

3. Study following steps and determine the correct order
(1)   Open a connection to MySql server
(2)   Execute the SQL query
(3)   Fetch the data from query
(4)   Select database
(5)   Close Connection
a. 1, 4, 2, 3, 5
b. 4, 1, 2, 3, 5
c. 1, 5, 4, 2, 1
d. 4, 1, 3, 2, 5
 

4. Which of the following is not a session function?
a.       sssion_decode
b.      session_destroy
c.       session_id
d.      session_pw
 

5. When uploading a file if the UPLOAD_ERR-OK contains value 0 it means
a.       Uplaod is not successful, error occurred
b.      The file uploaded with success
c.       Uploaded file size is 0
d.      File upload progress is 0% completed 
 
6.      Which of the following delimiter syntax is PHP's default delimiter syntax
a.      <? php ?>
b.      <%   %>
c.       <?     ?>
d.      <script language="php"> </script>


7.      Which of the following statement produce different output
a.      <?echo "This is php example"; ?>
b.      <P="This is php example"; ?>
c.       <?PHP echo "This is php example"; php?>
d.      <script language="php"> print "This is php example";</script>


8.      Which of the following delimiter is ASP style?
a.     
b.      <% %>
c.       <? ?>
d.      <script language="php"> </script>


9.      Php supports all four different ways of delimiting. In this context identify the false statement
a.      You can use any of the delimiting style
b.      You can use different delimiting styles in same page
c.       You can use any delimiting style but must use a single style consistently for a page
d.      Variables declared in previous blocks are remenbered on later blocks too!


10.      Which of following commenting is supported by Php
a.      Single line c++ syntax - //
b.      Shell syntax - #
c.       Both of above
d.       None of above


11.      To produce the output6 I love the summer time, Which of the ofllowing statement should be used?
a.      <? Php print ("<P> I love the summer time</p>"Wink;?>
b.      <? Php $ season="summer time"; print"<p> I love the $ season</p>"; ?>
c.       <?Php $ message="<p> I love the summer time </p>; ecdho $ message; ?>
d.      All of above


12.      Which of following function return 1 when output is successful?
a.      echo ( )
b.      print ( )
c.       both
d.      None


13.      Which of followng statement is more suitable if you want to output a blend of static text and dynamic information stored within one or several variables?
a.      echo ( )
b.      print ( )
c.       Print f ( )
d.      None of above


14.      Which of the following type specifier is invalid in print f ( ) functions
a.      % a
b.      % b
c.       % c
d.      % d


15. Which of the following function can assign the output to a string variable
a.      echo ( )
b.      print ( )
c.       print f ( )
d.      s print f ( )


16. Which of the following data type is not seal or datetype supported by PHP
a.      Array
b.      String
c.       Float
d.      Boolean


17. Which of the following data type is compound datatype supported by PHP
a.      Array
b.      String
c.       Float
d.      Boolean


18. If a boolean variable $ alive= 5;
a.      $ alive is false
b.      $ alive is true
c.       $ alive is overflow
d.      the statement is snot valid


19. For integer data type PHP 6 introduced
a.      8 bit integer value
b.      16 bit integer value
c.       32 bit integer value
d.      64 bit integer value


20. For integer data type PHP 5 and earlier supported
a.      8 bit integer value
b.      16 bit integer value
c.       32 bit integer value
d.      64 bit integer value


 

 

Answers:



 
1. In mail($param2, $param2, $param3, $param4), the $param2 contains:
d.      The subject

2. mysql_connect( ) does not take following parameter
d.      database name

3. Study following steps and determine the correct order
(1)   Open a connection to MySql server
(2)   Execute the SQL query
(3)   Fetch the data from query
(4)   Select database
(5)   Close Connection
a. 1, 4, 2, 3, 5

4. Which of the following is not a session function?
d.      session_pw

5. When uploading a file if the UPLOAD_ERR-OK contains value 0 it means
b.      The file uploaded with success 

6.      Which of the following delimiter syntax is PHP's default delimiter syntax
a.     

7.      Which of the following statement is invalid?
c.       <?PHP echo "This is php example"; php?>

8.      Which of the following delimiter is ASP style?
b.      <% %>

9.      Php supports all four different ways of delimiting. In this context identify the false statement
c.       You can use any delimiting style but must use a single style consistently  for a page

10.      Which of following commenting is supported by Php
c.       Both of above

11.      To produce the output "I love the summer time", Which of the ofllowing statement should be used?
d.      All of above

12.      Which of following function return 1 when output is successful?
b.      print ( )

13.      Which of followng statement is more suitable if you want to output a blend of static text and dynamic information stored within one or several variables?
c.       Printf ( )

14.      Which of the following type specifier is invalid in print f ( ) functions
a.      % a
 

15. Which of the following function can assign the output to a string variable
d.      sprintf ( )

16. Which of the following data type is not seal or datetype supported by PHP
a.      Array
 

17. Which of the following data type is compound datatype supported by PHP
a.      Array

18. If a boolean variable $ alive= 5;
b.      $ alive is true
 

19. For integer data type PHP 6 introduced
d.      64 bit integer value

20. For integer data type PHP 5 and earlier supported
c.       32 bit integer value
 

Composed and Presented for PS Exam

 

Subscribe

Wish to get contents in your Email?

Enter your email address:

Who's Online

We have 176 guests online

Sharing Enriches!

You are here: MCQ Bank php PHP - Multiple Choice Questions (MCQs) - Objective Questions Set 2