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

Home » PHP » PHP Introduction » Question
  1. What will be the output of the following php code?
    <?php
    $n = "12";
    $n1 = "21";
    print $n+$n1;
    ?>
    1. 33
    2. Error
    3. 12+21
    4. 12
    5. 21
Correct Option: A

The numbers inside the double quotes are considered as integers and not string, therefore the value 33 is printed and not 12+21.



Your comments will be displayed only after manual approval.