Page 1 of 1

Whats the difference between...

Posted: Sun Feb 23, 2003 9:05 am
by EXDev
Hi,
anyone can show me the difference between
$foo .="some string or $variable"
and
$foo = "some sting or $variable"
i've seen ppl use the first one in some tutorial page but didn't explain the different between them, hope some expert here could help me out.
Thanks

Posted: Sun Feb 23, 2003 9:42 am
by volka
  • There are some shortcuts for assignment in php (like in C)
  • $a+=$b --> $a = $a + $b
  • $a-=$b --> $a = $a - $b
  • $a.=$b; --> $a = $a . $b
  • ...
the meaning of the dot is described at http://www.php.net/manual/en/language.o ... string.php

Posted: Sun Feb 23, 2003 9:50 am
by EXDev
thanks volka
i know the -= and += but forgot .=
the page u referred me to recalls me that i've read something about .= too.
Thanks alot