PHP Multiple Choice Questions – OOPs

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “OOPs”. 1. The practice of separating the user from the true inner workings of an application through well-known interfaces is known as _________ a) Polymorphism b) Inheritance c) Encapsulation d) Abstraction 2. Which of the following term originates from the Greek language that … Read more

advertisement

PHP Questions & Answers – Arrays – 5

This set of PHP Questions and Answers focuses on “Arrays – 5”. 1. What will be the output of the following PHP code? <?php $fruits = array ("mango", "apple", "pear", "peach"); $fruits = array_flip($fruits); echo ($fruits[0]); ?> a) mango b) error c) peach d) 0 2. Which of the functions is used to sort an … Read more

advertisement

PHP Coding Questions and Answers – Arrays – 4

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “Arrays – 4”. 1. What will be the output of the following PHP code? <?php$cars = array("Volvo", "BMW", "Toyota");echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";?> a) I like Volvo BMW and … Read more

advertisement

PHP Coding Questions and Answers – Arrays – 3

This set of Tough PHP Questions & Answers focuses on “Arrays – 3”. 1. What will be the output of the following PHP code? <?php $age = array("Harry" => "21", "Ron" => "23","Malfoy" => "21"); array_pop($age); print_r(array_change_key_case($age, CASE_UPPER));?> a) Array ( [Harry] => 21 [Ron] => 23 [Malfoy] => 21 ) b) Array ( [HARRY] … Read more

advertisement

PHP Coding Questions and Answers – Arrays – 2

This set of Tricky PHP Questions & Answers focuses on “Arrays – 2”. 1. What will be the output of the following PHP code? <?php$cars = array("Volvo", "BMW", "Toyota");echo "I like " . $cars[2] . ", " . $cars[1] . " and " . $cars[0] . ".";?> a) I like Volvo, Toyota and BMW b) … Read more

advertisement

PHP Multiple Choice Questions – Array

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “Array”. 1. PHP’s numerically indexed array begin with position ___________ a) 1 b) 2 c) 0 d) -1 2. Which of the following are correct ways of creating an array? i) state[0] = "karnataka"; ii) $state[] = array("karnataka"); iii) $state[0] = "karnataka"; iv) … Read more

advertisement

PHP Questions & Answers – In-Built Functions in PHP

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “In-Built Functions in PHP”. 1. Which of the following PHP functions accepts any number of parameters? a) func_get_argv() b) func_get_args() c) get_argv() d) get_argc() 2. Which one of the following PHP functions can be used to find files? a) glob() b) file() c) … Read more

advertisement

PHP Multiple Choice Questions – Functions

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “Functions”. 1. How to define a function in PHP? a) function {function body} b) data type functionName(parameters) {function body} c) functionName(parameters) {function body} d) function functionName(parameters) {function body} 2. Type Hinting was introduced in which version of PHP? a) PHP 4 b) PHP … Read more

advertisement

PHP Questions & Answers – Basics – 3

This set of PHP Questions and Answers for Freshers focuses on “Basics – 3”. 1. What will be the output of the following PHP code? <?php $a = 5; $b = 5; echo ($a === $b); ?> a) 5 === 5 b) Error c) 1 d) False 2. Which of the below symbols is a … Read more

advertisement

PHP Questions & Answers – Basics – 2

This set of PHP Questions and Answers focuses on “Basics – 2”. 1. Which is the right way of declaring a variable in PHP? i) $3hello ii) $_hello iii) $this iv) $This a) Only ii) b) Only iii) c) ii), iii) and iv) d) ii) and iv) 2. What will be the output of the … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.