Wednesday, April 19, 2017

PHP Multiple Choice Questions and Answers

1. PHP is a ______ typed language.
A. User
B. Loosely
C. Server
D. System
2. What does open() function do in PHP?
A. Used to open a PHP file
B. It is used to open remote servers
C. It used to open PHP folder
D. It is used to open remote computers
3. Where do the session_start () functions appear in PHP?
A. Anyway whatever
B. with the <html> tag
C. After the C <html> tag
D. Before <html> tag
4. What does the PHP Interpreter do?
A. It translates client Language to System Language
B. It creates a link between ISP & Server
C. It processes the HTML and PHP files
D. All of these
5. Which of the following is used to insert comments in PHP?
A. //
B. /* … */
C. & … &
D. Only A & B
6. What does sprintf() function do in PHP?
A. it launch output to a variable
B. it publishes the output of the program
C. it launch output to a variable converting into string
D. it publishes the output of program converting into string
7. Variables are case-sensitive in PHP?
A. True
B. False
8. Which function show the information about PHP?
A. info()
B. sysinfo()
C. phpinfo()
D. php_info()
9. What does isset() function do in PHP?
A. There is no function in PHP
B. It is not set to variable or does not check
C. ensure whether it is free or not variable
D. It verifies whether the variable string or integer
10. How PHP files can be entered?
A. Via web browser
B .through HTML file
C. Web server via
D. Above all Answer:
1 – B / 2 – A / 3 – D / 4 – C / 5 – D / 6 – A / 7 – A / 8 – C / 9 – B / 10 – C

1. What is the use of strlen( ) function in PHP?
A. It shows the type of a string
B. It shows a string value
C. It shows the length of a string
D. This shows the subset value of a string
2. Which of the subsequent is the Concrete Operator in PHP?
A. + (Plus)
B. . (dot)     
C. & (Ampersand)
D. % (Percentage)

3. Which of the following is not PHP Loops?
A. while
B. do while
C. for
D. do for

4. What is the use of strpos( ) function in PHP?
A. hunt for a number within a string
B. hunt for Spaces within a string
C. hunt for a character/text within a string
D. hunt for a Capitalized string/text within a string

5. Where setcookie( ) function must show in PHP?
A. Before tag
B. After tag
C. In tag
D. Anywhere

6. What does the hash (#) sign mean in PHP?
A. It indicates appearance that is commented out.
B. It indicates variable announcement.
C. It indicates function declaration.
D. No uses in PHP.

7. How to name a variable in PHP?
A. $variable_name = value
B. $variable_name = value;
C. $variable_name == value;
D. $variable_name as value;

8. The uses of strcmp( ) function in PHP?
A. It compares strings counting case
B. It compares strings without case
C. It compares strings only Uppercase
D. It compares strings only lowercase

9. What will be the outcome of merge a string with another data type in PHP?
A. int
B. float
C. string
D. double

10. Data for a cookie pile up in _________ in PHP?
A. In ISP Computer
B. in User’s Computer
C. In Server Computer
D. It depends on PHP Coding
Answer:
1 – C / 2 – B / 3 – D / 4 – C / 5 – A / 6 – A / 7 – B / 8 – A / 9 – C / 10 – B

1. PHP Stands for
A. Php Hypertext Processor
B. Php Hypertext Preprocessor
C. Php Hypermarkup Preprocessor
D. Php Hypermarkup Processor

2. PHP is _______ scripting language.
A. Server-side
B. Clint-side     
C. Middle-side
D. Out-side

3. PHP scripts are executed on _________
A. ISP Computer
B. Client Computer
C. Server Computer
D. It depends on PHP scripts

4. PHP Scripts begin with ________
A. <php> … </php>
B.  <? php …. ?>
C. ?Php …? Php
D. <p> … </p>

5. Which of the following statements published in PHP?
A. Out
B. Write
C. Echo
D. Display

6. In PHP, every statement must end with ______
A. (Dot)
B.; (semicolon)
C. / (slash)
D.: (colon)

7. Variables name starts within php_____
A.! (Exclamation)
B. & (Ampersand)
C. * (Asterisk)
D. $ (Dollar)

8. Variables are case sensitive In PHP Language
A. True
B. False
C. Depends on website
D. Depends on server

9. A variable needs to be declared before assigning In PHP
A. True
B. False
C. Depends on website
D. Depends on server

10. Which of the following is not the possibility of Variable in PHP?
A. Local
B. Global
C. Static
D. Extern
Answer:
1 – B / 2 – A / 3 – C / 4 – B / 5 – C / 6 – B / 7 – D / 8 – A / 9 – B / 10 – D

1.  Trace the odd data type
A. floats
B. integer
C. doubles
D. Real number

2.  Which of the following are applicable float values?
a. 4.5678
b. 4.0
c. 7e4
d. All of above

3.  In php string data are
A. enclosed by single quote
B. enclosed by double quote
C. enclosed by <<< identifier
D. All of above

4.  Which of the following define method is known as string Interpolation
A. enclosed by single quote
B. enclosed by double quote
C. enclosed by <<< identifier
D. All of above

5.  Which data types is delicacy as arrays
a. Integer
b. Float
c. String
d. Booleans

6.  Which of following is complex data type?
a. Array
b. Objects
c. Both
d. None

7.  Casting operator launch in PHP 6 is
a. (array)
b. (int64)
c. (real) or (double) or (float)
d. (object)

8.  When a significant identifier in PHP you should consider that
a. The identifier is case sensitive. So the $result is different than $ result
b. Identifiers can be any length
c. Both of above
d. None of above

9.  Discover the unacceptable identifier
A. my-function
B. size
C. –some word
D. This that

10. Which of following variable task is 'by value' task in PHP

A. $value1= $value?
B. $value1= & $value?
C. $value1= & $value?
D. None

11. Discover the variable scope that is not supported by PHP
a. Local variables
b. Function parameters
c. Hidden variables
d. Global variables

13. The variable scope on which a variable does not misplace its value when the function exists and use that value if the function is called again is:
A. Local
B. function parameter
C. static
D. None of above

14. The missing connection operator % is used in PHP for
A. percentage
B. bitwise or
C. division
D. modulus

15. The missing associative dot operator (.) is used in PHP for

A. multiplication
B. concatenation
C. separates object and its member
D. delimiter

17. Which of the following functions need the allow-URL-fopen must be enabled?
A. include ()
B. require ()
C. both of above
D. None of above

18. Which function contains the individual file even the declaration evaluates to false in which block the function is placed?

A. include ()
B. require ()
C. both of above
D. None of above

19. on malfunction of which statement the script implementation stops displaying error/warning message?
A. include ()
B. require ()
C. both of above
D. None of above

20. Trace the function that does carry on the script implementation even if the file inclusion fails
A. include ()
B. require ()
C. both of above
D. None of above

Answers:
1. B.  Integer
2.  D.  All of above
3.  D.  All of above
4.  C.  Delimited by <<< identifier
5.  C.  String
6.  C.  Both
7.  B.  (int64)
8.  C.  Both of above
9. d.  This & that
10. A.  $value1= $value2
11. C.  Hidden variables
13. C.  Static
14. D.  Modulus
15. B.  Concatenation
17. C.  Both of above
18. B.  Require ()
19. B.  Require ()
20. A.  Include ()


No comments:

Post a Comment