"> What will be the output of the following PHP code?<?php$n

Home » PHP » PHP Sorting Arrays » Question
  1. What will be the output of the following PHP code?
    <?php
    $n = array ("16", "Interview Mania", 10, "4");
    echo (array_sum ($n));
    ?>
    1. 16
    2. 10
    3. 30
    4. Interview Mania
    5. 4
Correct Option: C

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.



Your comments will be displayed only after manual approval.