PHP MCQ Arrays in PHP MCQ Question #2393
Single Choice Not Set

QWhat will be the output of the following PHP code?
< ?php 
    $number = array ("4", "hello", 2);
    echo (array_sum ($number));
?>

ID: #2393 Arrays in PHP MCQ 1,193 views
Question Info
#2393Q ID
Not SetDifficulty
Arrays in PHP MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 4hello2
  • B 4
  • C 2
  • D 6
Correct Answer

Explanation

The array_sum() function add all the values of the input array together, returning the final sum. If a string datatype is found, it’ll be ignored.

Share This Question

Challenge a friend or share with your study group.