MCQs > IT & Programming > PHP > What's the output? function cube($n) { return($n * $n * $n); } $a = array(1, 2, 3, 4, 5); $b = array_map('cube', $a); print_r($b);

PHP MCQs

What the result of the following code: function cube($n) { return($n * $n * $n); } $a = array(1, 2, 3, 4, 5); $b = array_map("cube", $a); print_r($b);

Answer

Correct Answer: Array ( [0] => 1 [1] => 8 [2] => 27 [3] => 64 [4] => 125 )

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