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

Home » PHP » PHP Syntax » Question
  1. What will be the output of the following PHP code ?
    <?php
    $name1= Ajit;
    $name2= Rahul;
    echo "$name1"."$name2";
    ?>
    1. Ajit
    2. Rahul
    3. AjitRahul
    4. Nothing
    5. Error
Correct Option: E

It has to be $name1= “Ajit”; and $name2= “Rahul”; therefore the error.



Your comments will be displayed only after manual approval.