php string operators



PHP String Operators

PHP has main two string operators ( . ) concatenation and ( .= ) concatenation assignment.

concatenation ( . ) string operator concatenation operator used to join two strings.

Example of (.) concatenation

<?php

$first = “meera “;
$second = “academy”;

$concat = $first . $second;

echo $concat;

?>

The output is:
meera academy

( .= ) concatenation assignment example

<?php

$first = “meera “;
$second = “academy”;

$first .= $second;

echo $first;

?>

The output is:
meera academy

 

Leave a Reply

Your email address will not be published. Required fields are marked *