Home » PHP » PHP Operators » Question
  1. What will be the output of the following PHP code ?
    <?php
    $str1 = "Hello ";
    $str2 = "Interview ";
    $str3 = "Mania ";
    $str1 .= $str2 .= $str3 ;
    echo $str1;
    echo $str2;
    ?>
    1. Hello Interview Mania
    2. Interview Mania
    3. Hello Interview Mania Interview Mania
    4. Interview Mania Interview Mania
    5. None of these
Correct Option: C

The str1 .= str2 is a shorthand for str1 = str1.str2 and this is evaluated from right to left.



Your comments will be displayed only after manual approval.