Explore topic-wise MCQs in Php.

This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your Php knowledge and support exam preparation. Choose a topic below to get started.

1.

What will be the output of the following PHP code? a) I like Volvo BMW and Toyota.b) I like Volvo, BMW and Toyota)c) I like Volvo, BMW and Toyota.d) I like. Volvo.,. BMW. and. Toyot

A. I like Volvo BMW and Toyota.
B. I like Volvo, BMW and Toyota)
C. I like Volvo, BMW and Toyota.
D. I like. Volvo.,. BMW. and. Toyota)View Answer
Answer» C. I like Volvo, BMW and Toyota.
2.

Which function returns an array consisting of associative key/value pairs?

A. count()
B. array_count()
C. array_count_values()
D. count_values()
Answer» D. count_values()
3.

Which of the following function is used to get the value of the previous element in an array?

A. last()
B. before()
C. prev()
D. previous()
Answer» D. previous()
4.

Which in-built function will add a value to the end of an array?

A. array_unshift()
B. into_array()
C. inend_array()
D. array_push()
Answer» E.
5.

Which of the following PHP function will return true if a variable is an array or false if it is not an array?

A. this_array()
B. is_array()
C. do_array()
D. in_array()
Answer» C. do_array()
6.

Which of the following are correct ways of creating an array?

A. iii) and iv)
B. ii) and iii)
C. Only i)
D. ii), iii) and iv)View Answer
Answer» B. ii) and iii)
7.

PHP’s numerically indexed array begin with position ___________

A. 1
B. 2
C. 0
D. -1
Answer» D. -1