Answers for "php append 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
4

concatenate string php

<?php 

// First String 
$a = 'Hello'; 

// Second String 
$b = 'World!'; 

// Concatenation Of String 
$c = $a.$b; 

// print Concatenate String 
echo " $c \n"; 
?>
Posted by: Guest on May-08-2020
0

append variable to string php

<?php
  $example = "Example text"
  echo ("Example " . $example ." text")
?>
Posted by: Guest on August-25-2021

Browse Popular Code Answers by Language