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 *

9 + 8 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">