Menu

Add Topic

Forum

waiting answer July 28, 2021

How to combine two strings in PHP

Answers
June 10, 2021

It can do in two ways

  1. Using Concatenation Operator
  2. Using Concatenating assignment operator

Using Concatenation Operator

     <?php
        // First String
        $string1 = 'Welcome';            
        // Second String
        $string2 = ' to';  
        // Concatenation Of String
        $string3 = $string1.$string2; 
        // print Concatenate String
        echo " $string3 \n";
    ?>

OUTPUT

        Welcome to

0 0

Please Login to Post the answer

Leave an Answer