Concept

How can strings be concatenated in PHP?

ComputerScienceOne / String Concatenation

"Strings in PHP can be concatenated (combined) in several different ways. One way you can combine strings is by using the concatenation operator. In PHP the string concatenation operator is a single period.\n\n1 $s = \"Hello\";\n\n2 $t = \"World!\";\n\n3 $msg = $s . \" \" . $t; //msg contains \"Hello World!\"\n\nAnother way you can combine strings is by placing variables directly inside a string. The variables inside the string are replaced with the variable’s values.\n\nExample:\n\n1 $x = 13;\n\n2 $name = \"Starlin\";\n\n3 $msg = \"Hello, $name, your number is $x\";\n\n4 //msg contains the string \"Hello, Starlin, your number is 13\""

Related Ideas

How can strings be concatenated in PHP? | ComputerScienceOne | Bifalgorithm | Bifalgorithm