1<?php
2$number = 8;
3$txt = "the number is".$number.", ok?"; //Use a dot to combine
4echo $txt;
5?>
1phpCopy<?php
2$mystring1 = "This is the first string. ";
3$mystring2 = "This is the second string. ";
4$mystring3 = "This is the third string. ";
5$mystring4 = "This is the fourth string. ";
6$mystring5 = "This is the fifth string.";
7
8$mystring1 .= $mystring2 .= $mystring3 .= $mystring4 .= $mystring5;
9echo($mystring1);
10?>
11
1<?php
2 $name = "Paul";
3 $age = 26;
4
5 echo "My name is {$name}, I'm {$age} years old ";