Answers for "php add string to string"

PHP
6

php append string

<?php
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"

$a = "Hello ";
$a .= "World!";     // now $a contains "Hello World!"
?>
Posted by: Guest on February-12-2020
8

php concat

$a = "hello";
$b = "world";
$c = $a . " " . $b;

echo $c; // hello world
Posted by: Guest on February-24-2020
1

append variable into string php

echo "'$animal'";
Posted by: Guest on January-27-2021
0

join string php

<?php
$arr = array('Hello','World!','Beautiful','Day!');
echo join(" ",$arr);
?>
Posted by: Guest on April-09-2020
0

php string plus string

<?php
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"

$a = "Hello ";
$a .= "World!";     // now $a contains "Hello World!"
?>
Posted by: Guest on August-03-2020
-1

php concatenate two variables

$string = "the color is ";
$string .= "red";

echo $string; // gives: the color is red
Posted by: Guest on May-23-2020

Browse Popular Code Answers by Language