Arrays MCQs
Practice Arrays MCQs for competitive exams.
Arrays MCQs
Practice questions from this topic.
What array will you get if you convert an object to an array?
Correct Answer: A
What functions count elements in an array? 1. count 2. Sizeof 3. Array_Count 4. Count_array
Correct Answer: B
What function computes the difference of arrays?
Correct Answer: A
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?
Correct Answer: B
There are three different kind of arrays:
Correct Answer: C
Which array function checks if the specified key exists in the array?
Correct Answer: B
What will the following script output? <?php $array = array (1, 2, 3, 5, 8, 13, 21, 34, 55); $sum = 0; for ($i = 0; $i
Correct Answer: A
Which function returns an array consisting of associative key/value pairs?
Correct Answer: C
Which function can be used to move the pointer to the previous array position?
Correct Answer: C
Which in-built function will add a value to the end of an array?
Correct Answer: D
Which function will return true if a variable is an array or false if it is not?
Correct Answer: B
What will be the output of the following php code? array( "population" => "11,35,000" , "captial" => "Bangalore" ) , "Tamil Nadu" => array( "population" => "17,90,000" , "captial" => "Chennai" ) ) ; echo $states [ "karnataka" ][ "population" ] ; ?>
Correct Answer: B
