Concatenating two strings in PHP

PHP

Examples:
Input: string1: Hello string2: World! Output: HelloWorld! Input: string1: engineerfor string2: engineer Output: engineerforengineer 
Code # 1:  
// First line $a = 'Hello' ;  
// Second line $b = 'World!' ;  
// String concatenation $c = $a . $b ;  
// output the concatenated string echo "$c" ; ?>
Output:
HelloWorld! 
Code # 2:  
// First line $fname = 'John' ;  
// Second line $lname = 'Carter!' ;  
// String concatenation $c = $fname . "" . $lname ;  
// output the concatenated string echo "$c" ; ?>
Output:
John Carter! 
Code # 3:  
// First line $a = 'Hello' ;  
// $a now contains & quot; HelloWorld! & quot; $a . = "World!" ;  
// Print line $a echo "$a" ; ?>
Output:
HelloWorld! 




Get Solution for free from DataCamp guru