Page 1 of 1

What is .= doing exactly?

Posted: Wed Oct 02, 2013 3:55 am
by oldcelt

Code: Select all

$message .= "<h1>This is headline.</h1>";
This is one of the headers in some php email code intended for sending HTML.

I don't quite understand what the .= construct is doing. Can anyone help please?

Re: What is .= doing exactly?

Posted: Wed Oct 02, 2013 6:08 am
by Celauran
Concatenation and assignment.

Code: Select all

$string = "foo" . "bar";
// Same thing
$string = "foo";
$string .= "bar";

Re: What is .= doing exactly?

Posted: Wed Oct 02, 2013 7:02 am
by oldcelt
Ta very much!

Re: What is .= doing exactly?

Posted: Thu Oct 03, 2013 4:22 am
by priyankagound
Its Concatenation assignment ( .= ).

for example:-
$txt1 = "Developers"
$txt1 .= " Network"

Now $txt1 contains "Developers Network"

Hope i cleared your doubts.