Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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

What will be the output of the following PHP code?
<?php
$number = array (“4”, “hello”, 2);
echo (array_sum ($number));
?>
a) 4hello2
b) 4
c) 2
d) 6

Answer: d
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.

Join The Discussion