Php Objective Questions with Answers for written test exams 19

Question 19
What will the following script output?


$a = array (‘a’ => 20, 1 => 36, 40);

array_rand ($a);

echo $a[0];

?>

A. A random value from $a

B. ‘a’

C. 20

D. 36

E. Nothing
Answers 19


ANSWER E Only E is correct.The $a array doesn’t have any element with a numeric key of

zero, and the array_rand() function does not change the keys of the array’s elements—

only their order.

  







Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---