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? Link to comment https://forums.phpfreaks.com/topic/261622-add-a-dot-before-the-equal-in-php/ 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. Link to comment https://forums.phpfreaks.com/topic/261622-add-a-dot-before-the-equal-in-php/#findComment-1340604 Share on other sites More sharing options...
sungpeng Posted April 26, 2012 Author Share Posted April 26, 2012 Thank you Link to comment https://forums.phpfreaks.com/topic/261622-add-a-dot-before-the-equal-in-php/#findComment-1340608 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.