Php Quiz Online with Answer

php quiz

PHP Online Quiz Following quiz provides Multiple Choice Questions (MCQs) related to PHP programming language. You will have to read all the given answers and click on view answer option.

These php online test quizzes on php web development, database have answers available with pdf, which in very useful in interview and also in php subject exam.

Return to Programming Language Quiz List

1. PHP Stands for…

A. Php Hypermarkup Preprocessor

B. Php Hypertext Processor

C. Php Hypermarkup Processor

D. Php Hypertext Preprocessor

View Answer
D. Php Hypertext Preprocessor

2. PHP is which type scripting language?

A. Out-side

B. Clint-side

C. Server-side

D. Middle-side

View Answer
C. Server-side

3. Which of the following is used to add comments in PHP?

A. & … &

B. //

C. /* … */

D. Only B & C

View Answer
D. Only B & C

4. PHP scripts are executed on?

A. Client Computer

B. It depends on PHP scripts

C. ISP Computer

D. Server Computer

View Answer
D. Server Computer

5. Variables are case-sensitive in PHP?

A. True

B. False

View Answer
A. True

6. PHP Scripts starts with?

A. <?php …. ?>

B. <php> … </php>

C. <p> … </p>

D. ?php … ?php

View Answer
A. <?php …. ?>

7. Which of the following statements prints in PHP?

A. Echo

B. Display

C. Out

D. Write

View Answer
A. Echo

8. In PHP Language variables name starts with?

A. * (Asterisk)

B. $ (Dollar)

C. ! (Exclamation)

D. & (Ampersand)

View Answer
B. $ (Dollar)

9. In PHP, each statement must be end with?

A. / (slash)

B. ; (semicolon)

C. . (dot)

D. : (colon)

View Answer
B. ; (semicolon)

10. In PHP Language variables are case sensitive?

A. Depends on website

B. False

C. True

D. Depends on server

View Answer
C. True

11. Data for a cookie stored in _____ in PHP?

A. In ISP Computer

B. It depends on PHP Coding

C. In Server Computer

D. In User’s Computer

View Answer
D. In User’s Computer

12. What does the PHP Interpreter do?

A. It creates connection between ISP & Server

B. It processes the HTML and PHP files

C. It translates User Language to System Language

D. All of these

View Answer
B. It processes the HTML and PHP files

13. In PHP a variable needs to be declaring before assign…

A. Depends on website

B. Depends on server

C. True

D. False

View Answer
D. False

14. Which of the following is not the scope of Variable in PHP?

A. Local

B. Extern

C. Static

D. Global

View Answer
B. Extern

15. PHP is which typed language?

A. Server

B. Loosely

C. System

D. User

View Answer
B. Loosely

16. Which is the Concatenation Operator in PHP?

A. Dot (.)

B. Plus (+)

C. Ampersand (&)

D. Percentage (%)

View Answer
A. Dot (.)

17. Where session_start() function must appear in PHP?

A. With <html> tag

B. Before <html> tag

C. After <html>tag

D. Anywhere

View Answer
B. Before <html> tag

18. How to define a variable in PHP?

A. $variable_name == value;

B. $variable_name = value

C. $variable_name as value;

D. $variable_name = value;

View Answer
D. $variable_name = value;

19. What does fopen() function do in PHP?

A. It used to open folders in PHP

B. It used to open files in PHP

C. It used to open Remote Computer

D. It used to open Remote Server

View Answer
B. It used to open files in PHP

20. What does sprintf() function do in PHP?

A. it sends output to a variable converting into string

B. it prints the output of program

C. it prints the output of program converting into string

D. it sends output to a variable

View Answer
D. it sends output to a variable

21. What does isset() function do in PHP?

A. It checks whether variable is free or not

B. There is no such function in PHP

C. It checks whether variable is string or integer

D. It checks whether variable is set or not

View Answer
D. It checks whether variable is set or not