Web Technology - Old Questions

10. How can you define variables in PHP? Define any two variable of string types and display their results after concatenation.[1+4]

5 marks | Asked in 2076(new)

In PHP, a variable is declared using a $ sign followed by the variable name. 

        $variablename = value;

E.g.

    $str="hello string";

    $x=200;

    $y=44.6;


Second Part:

<?php

       $fname = 'Jayanta';     // First String

       $lname = 'Poudel';     // Second String

       $fullname = $fname." ".$lname;    // Concatenation Of String

       echo " $fullname \\n";     // print Concatenate String

?>