PrepAway - Latest Free Exam Questions & Answers

Which of the following expressions will evaluate to a random value from an array below?

Which of the following expressions will evaluate to a random value from an array below?
$array = array(“Sue”,”Mary”,”John”,”Anna”);

PrepAway - Latest Free Exam Questions & Answers

A.
array_rand($array);

B.
array_rand($array, 1);

C.
shuffle($array);

D.
$array[array_rand($array)];

E.
array_values($array, ARRAY_RANDOM);


Leave a Reply

Your email address will not be published. Required fields are marked *