MCQs > IT & Programming > PHP > Consider the following 2D array in PHP: $array = array(array(141,151,161), 2, 3, array(101, 202, 303)); Which will display all values in the array?

PHP MCQs

Consider the following 2D array in PHP:

$array = array(array(141,151,161), 2, 3, array(101, 202, 303));

Which of the following will display all values in the array?

Answer

Correct Answer: function DisplayArray($array) { foreach ($array as $value) { if (is_array($value)) { DisplayArray($value); } else { echo $value . " "; } } } DisplayArray($array);

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it