divinedesigns1 Posted June 13, 2012 Share Posted June 13, 2012 ok i been trying to get this which is weird because it just combine 2 things together, so what does .= really do and what does it really mean? i mean wouldnt it be easy to just use an = and call it a day? a brief detail would do, im still gonna be reading about it on google Link to comment Share on other sites More sharing options...
birbal Posted June 13, 2012 Share Posted June 13, 2012 http://in.php.net/manual/en/language.operators.assignment.php its concatenate an operand and then assign it to another. Link to comment Share on other sites More sharing options...
thescientist Posted June 13, 2012 Share Posted June 13, 2012 (edited) no, because they are not the same thing. if they were, it would almost be no point in having them. first you need to understand your operators. = is the assignment operator. is the contactenation operator I assume you know what each one does on it's own. $x = 5;echo($x); //5 $x = 'hello';$y = 'world';$z = $x . ' ' . $y;echo($z); //hello world .= means to concatentate what is on the right of the assignment operator to what is on the left of the assignment operator $x = 'hello';$x .= ' world';echo($x); //hello world Edited June 13, 2012 by thescientist Link to comment Share on other sites More sharing options...
divinedesigns1 Posted June 13, 2012 Author Share Posted June 13, 2012 ok, thank you Link to comment Share on other sites More sharing options...
Guest So Called Posted June 13, 2012 Share Posted June 13, 2012 $a .= $b; is just shorthand for $a = $a . $b; Link to comment Share on other sites More sharing options...
astralaaron Posted June 16, 2012 Share Posted June 16, 2012 $a .= $b; is just shorthand for $a = $a . $b; This would have made my head spin when I was just beginning Link to comment Share on other sites More sharing options...
Guest So Called Posted June 16, 2012 Share Posted June 16, 2012 There's also the following: +=-=*=/=&=%= http://www.w3schools.com/php/php_operators.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now