By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

Variable Declaration

P: 3
$variablename.= 10
Please explain the use '.="
Apr 29 '07 #1
Share this Question
Share on Google+
2 Replies


mwasif
Expert 100+
P: 801
It is same as
[PHP]$variablename = "some value";
$variablename = $variablename . 10;[/PHP]
Apr 29 '07 #2

100+
P: 136
Hi,

in php dot(.) is basically the string concatenation operator. so writing
[PHP]$var .= 10; [/PHP]
means,
[PHP]$var = $var . 10[/PHP];

here in this example 10 will be concatenated with the value of $var as string. There will be no mathematical addition if $var also contain number too.

susen
Apr 30 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.