?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
<?php
$number = array ("4", "hello", 2);
echo (array_sum ($number));
?>
<?php
$number = array ("4", "hello", 2);
echo (array_sum ($number));
?>
Answer & Solution
Correct Answer:
Option
D
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.
Join the Discussion
Login to post a comment or share your explanation.
Login