Blog
MCQs
PHP Basics MCQs With Answers
PHP Basics MCQs With Answers
By Aniket Singh
· Published March 23, 2022
· Updated
· A short read
MCQs On Basics - PHP 1. PHP stands for ......... hypertext processor pretext hyper processor preprocessor home page none of the above Answer: 1 : hypertext processor
2. What is the syntax of PHP code? <PHP> <? php ?> <? ?? // PHP // Answer: 2 : <? php ?> 3. What is the concatenation operator in PHP. Answer: 4 : . 4. What is correct way of declaring PHP variables ........ 5. PHP indexed array begin with position .......... Answer: 3 : 0 6. What is the correct way for creating array in PHP? weekday[0] = "monday"; $weekday[] = array("monday", "tuesday", "wednesday"); $weekday[0] = "monday"; $weekday = array("monday"); Answer: 3 : $weekday[0] = "monday"
7. PHP is _______ scripting language. client side server side browser side none of the above Answer: 2 : server side 8. Which function is used to sort array in ascending order? sort() rsort() dsort() none of the above Answer: 1 : sort() 9. There are three different kind of arrays: Numeric array, String array, Multidimensional array Numeric array, Associative array, Dimensional array Numeric array, Associative array, Multidimensional array Const array, Associative array, Multidimensional array Answer: 3 : Numeric Array, Associative Array, Multidimensional Array 10. Assume you would like to sort an array in ascending order by value while preserving key associations. Which of the following PHP sorting functions would you use? ksort() asort() krsort() sort() Answer: 2 : asort()
Found it useful? Share it
Written by
Aniket Singh
Software engineer and founder of letsBug
Aniket builds websites, apps and custom systems for businesses at letsBug, and explains how things work on the letsBug YouTube channel: electronics, code and science for curious minds.
← Newer post Newer post
Older post → Older post