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

Home » PHP » PHP Variables » Question
  1. What will be the output of the following PHP code ?
    <?php
    $n1 = 15;
    $n2 = 11;
    $R = "$n1 + $n2";
    echo "$R";
    ?>
    1. 15 + 11
    2. 15
    3. $n1 + $n2
    4. 11
    5. None of these
Correct Option: A

Variable R will store 15 + 11 because 15 + 11 is given in double-quotes.



Your comments will be displayed only after manual approval.