Today I will explain about String variables in PHP, PHP string variables are used to score and manipulate that data. Once we have created a string variable we can manipulate it. We can use string directly into function or it can be stored into variable.
$text=”My first string variable”;
Here we have created s string variable called text and then assign the text My first string variable to it. and then writing the value of the text variable for the output.
There is only one string operator in PHP to join two string values together, It is known as PHP Concatenation Operator.
Here is an example to join two string variables together.
$one = “My first”;
$two = “string variable”;
echo $one .” ” .$two;
My first string variable