Combining a string and a number : String Concatenation « String « PHP






Combining a string and a number

 
<?php
$str = "This is an example of ". 3 ." in the middle of a string.";
echo $str;
?>
  
  








Related examples in the same category

1.A period (.) character is used to combine two separate variables into a single string
2.A string and an integer value are added, and the result is an integer value.
3.Concatenating strings together
4.Concatenation operator ('.')
5.Joining and Disassembling Strings