PHP MCQ Quiz Question with Answer
Categories: PHP Interview questions and answers Experienced Freshers MCQ
PHP MCQ Quiz Question with Answer
1) PHP stands for -
- Hypertext Preprocessor
- Pretext Hypertext Preprocessor
- Personal Home Processor
- None of the above
Answer: (a)
2) Who is known as the father of PHP?
- Drek Kolkevi
- List Barely
- Rasmus Lerdrof
- None of the above
Answer: (c)
3) Variable name in PHP starts with -
- ! (Exclamation)
- $ (Dollar)
- & (Ampersand)
- # (Hash)
Answer: (b)
4) Which of the following is the default file extension of PHP?
- .php
- .hphp
- .xml
- .html
Answer: (a)
5) Which of the following is not a variable scope in PHP?
- Extern
- Local
- Static
- Global
Answer: (a)
6) Which of the following is correct to add a comment in php?
- & …… &
- // ……
- /* …… */
- Both (b) and (c)
Answer: (d) Both (b) and (c)
7) Which of the following is used to display the output in PHP?
- echo
- write
- Both (a) and (c)
Answer: (d) Both (a) and (c)
8) Which of the following is the use of strlen() function in PHP?
- The strlen() function returns the type of string
- The strlen() function returns the length of string
- The strlen() function returns the value of string
- The strlen() function returns both value and type of string
Answer: (b)
9) Which of the following is used for concatenation in PHP?
- + (plus)
- (Asterisk)
- . (dot)
- append ()
Answer: (c)
10) Which of the following starts with __ (double underscore) in PHP?
- Inbuilt constants
- User-defined constants
- Magic constants
- Default constants
Answer: (c) Magic constants