sungpeng Posted April 26, 2012 Share Posted April 26, 2012 .= I am wondering why sometime it is require to add a dot before the equal in php? Quote Link to comment Share on other sites More sharing options...
rythemton Posted April 26, 2012 Share Posted April 26, 2012 The dot equals (.=) is a shortcut: // The following: $something .= $more; // Is the same as the following: $something = $something . $more; Without the dot, whatever is in the variable will be replaced. $something="this"; $something = "that"; // now $something is 'that' $something .= "more"; // now $something is 'thatmore' It depends on what you are trying to do. Quote Link to comment Share on other sites More sharing options...
sungpeng Posted April 26, 2012 Author Share Posted April 26, 2012 Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.