Page 1 of 1

what is this .= ?

Posted: Mon Sep 22, 2008 5:49 am
by runrunforest
this .= happened toappear between two strings. I don't know what it means.

Re: what is this .= ?

Posted: Mon Sep 22, 2008 5:56 am
by onion2k
It's the concatenation operator. Essentially it means "add the content of this string on to the previous string".

Re: what is this .= ?

Posted: Mon Sep 22, 2008 5:58 am
by gsairam
Example:

<?php

$a = 3;
$a += 5; // sets $a to 8, as if we had said: $a = $a + 5;
$b = "Hello ";
$b .= "There!"; // sets $b to "Hello There!", just like $b = $b . "There!";
echo $b;
?>


Hope its a continuation of the previous result of the variable. Here the output will be

Hello There!

The above expamle may help you better..

Re: what is this .= ?

Posted: Mon Sep 22, 2008 12:28 pm
by runrunforest
only apply for strings ?

Re: what is this .= ?

Posted: Mon Sep 22, 2008 1:42 pm
by onion2k
runrunforest wrote:only apply for strings ?
Try it and see.

Re: what is this .= ?

Posted: Mon Sep 22, 2008 2:17 pm
by califdon
Better yet, read the manual. Syntax questions are best answered by a fast search at the appropriate documentation web site.

PHP: http://www.php.net/docs.php

MySQL: http://dev.mysql.com/doc/

HTML, Javascript, CSS: http://w3schools.com/