String Variables in PHP - PHP Strings with Example - How to Concatenate Strings in PHP


String Variables in PHP - PHP Strings with Example - How to Concatenate Strings in PHP 

As you know the PHP is loosely typed programming language and there is no data types so the simple variables are used to store the string in PHP and there are number of methods/functions for manipulate the string variables further.

For Example:-

<?php
$str="Hello PHP String";
echo $str;
?>

String Concatenation in PHP:-

As like other languages like Java, C# the php does not use the (+) symbol for concatenation of two or more strings here the (.) symbol used for this purpose.
Example:-

<?php
$str1="Hello";
$str2="PHP";
echo $str1.$str2;
?>



{ 0 comments... read them below or add one }

Post a Comment