"/>
Home / CSE MCQs / PHP MCQs :: Discussion

Discussion :: PHP MCQs

  1. What will be the output of the following PHP code?
    < ?php      $number = array ("4", "hello", 2);     echo (array_sum ($number)); ?>
  2. A.
    4hello2
    B.
    4
    C.
    2
    D.
    6

    View Answer

    Workspace

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


Be The First To Comment