Ninjakreborn Posted May 3, 2006 Share Posted May 3, 2006 Like css, is it better to stay away from php shorthand,the.= operator is to quickly add something to something, what is the long way, and which is better. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted May 3, 2006 Share Posted May 3, 2006 The ".=" is not shorthand, but a defined way of using the operator. Just like "+=", "-=", "++", "--".Use the language as it is defined and you will be fine.Ken Quote Link to comment Share on other sites More sharing options...
Caesar Posted May 3, 2006 Share Posted May 3, 2006 [!--quoteo(post=371061:date=May 3 2006, 03:45 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ May 3 2006, 03:45 PM) [snapback]371061[/snapback][/div][div class=\'quotemain\'][!--quotec--]The ".=" is not shorthand, but a defined way of using the operator. Just like "+=", "-=", "++", "--".Use the language as it is defined and you will be fine.Ken[/quote]ken is correct. And in regards to shorthand, I would say it is better practice not to use it if you plan to write something that may run on diferent servers in the future, where you may not have access to the PHP configuration. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted May 3, 2006 Share Posted May 3, 2006 The long hand way of [b].=[/b] is the following:[code]$var1 = $var1 . $var2[/code]The same with other ones such as += and -= etc Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted May 3, 2006 Author Share Posted May 3, 2006 thanks 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.