CSE MCQs :: PHP MCQs
- Which of the functions is used to sort an array in descending order?
-
Which of the following are correct ways of creating an array?(i) state[0] = "karnataka;(ii) $state[] = array("karnataka);(iii) $state[0] = "karnataka;(iv) $state = array("karnataka);
-
What will be the output of the following php code?
< ?php $states = array("karnataka" => array ( "population" => "11,35,000", "captial" => "Bangalore"), "Tamil Nadu" => array( "population" => "17,90,000", "captial" => "Chennai") ); echo $states["karnataka"]["population"]; ?>
- Which function will return true if a variable is an array or false if it is not?
- Which in-built function will add a value to the end of an array?
-
What will be the output of the following PHP code?
< ?php $state = array ("Karnataka", "Goa", "Tamil Nadu", "Andhra Pradesh"); echo (array_search ("Tamil Nadu", $state) ); ?>
-
What will be the output of the following PHP code?
< ?php $fruits = array ("apple", "orange", "banana"); echo (next($fruits)); echo (next($fruits)); ?>
- Which function can be used to move the pointer to the previous array position?
-
What will be the output of the following PHP code?
< ?php $fruits = array ("apple", "orange", array ("pear", "mango"), "banana"); echo (count($fruits, 1)); ?>
- Which function returns an array consisting of associative key/value pairs?