Jump to content

PHP newbie has newbie question


goodgeneguo

Recommended Posts

Hi I just get started with PHP so this question is probably quite dumb. (but i could not find answers to it by searching google or PHP.net)
I saw some code like :  $variable1 .= $variable2;  What does this mean?  What is the difference from $variable1 = $variable2 ?
thank you for your attention
Link to comment
https://forums.phpfreaks.com/topic/27489-php-newbie-has-newbie-question/
Share on other sites

I guess I should have been more specific.  I may be mistaken, but I believe all operators of the form:
$var1 [i]op[/i]= $var2;

are equivalent to:
$var1 = $var1 [i]op[/i] $var2;

I.E:
$var1 = $var1 + $var2 is equivalent to $var1 += $var2
$var1 = $var1 . $var2 is equivalent to $var1 .= $var2

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.