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

Home » PHP » PHP Introduction » Question
  1. What will be the output of the following PHP code?
    <?php
    $math = "25 students";
    $Science = 35;
    $math = $math + $Science;
    echo "$math";
    ?>
    1. 25
    2. 35
    3. Error
    4. 60
    5. None of these
Correct Option: D

The integer value at the beginning of the original $math string is used in the calculation. However if it begins with anything but a numerical value, the value will be 0.



Your comments will be displayed only after manual approval.