concatenate string php

Solutions on MaxInterview for concatenate string php by the best coders in the world

showing results for - "concatenate string php"
Victoria
03 Mar 2019
1
2var str1 = "Hello ";
3var str2 = "world!";
4var res = str1.concat(str2);
5// does not change the existing strings, but
6// returns a new string containing the text
7// of the joined strings.
Valeria
16 May 2020
1<?php
2$a "Hello ";
3$b $a "World!"// now $b contains "Hello World!"
4
5$a "Hello ";
6$a .= "World!";     // now $a contains "Hello World!"
7?>
Laetitia
13 Aug 2018
1$a = "hello";
2$b = "world";
3$c = $a . " " . $b;
4
5echo $c; // hello world
Aarón
26 May 2018
1<?php 
2
3// First String 
4$a = 'Hello'; 
5
6// Second String 
7$b = 'World!'; 
8
9// Concatenation Of String 
10$c = $a.$b; 
11
12// print Concatenate String 
13echo " $c \n"; 
14?> 
15
Damián
25 Sep 2016
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
Dewayne
12 Jul 2020
1<?php
2  $name = "Paul";	
3  $age = 26;
4
5  echo "My name is {$name}, I'm {$age} years old ";
similar questions
queries leading to this page
concatenate string php