How to use Concatenating of Two Strings in PHP


We will show you a simple example which will show you how to concate two string like “First Name” and “Last Name”  with the help of variable or without variable.

Here two string will become a single string and then it will be shown on the front end to the N Number of Users.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>String Variable Concate Example in PHP</title>
//This is the Simple example with the string variable concate
$fname = "John";
$lname = "Corner";
echo $fname." ".$lname;

//This is the Simple example with the direct string concate
echo "John"." "."Corner";
//This is just to show how the variable works when the store the string data.