nootkan Posted August 12, 2014 Share Posted August 12, 2014 Is there a reason for placing spaces between some of the two variables when doing a calculation using numbers and not others? For example in the book it shows: $taxrate = $tax/100; $taxrate = $taxrate + 1; $total = $total * $taxrate; I've tried it both ways and it works fine. Just wanted to be sure that there isn't something I missed that will be needed further down the road. Don't want to develop bad habits now. Also I've read that spaces add up the loading time and should be avoided. Is this true? Link to comment Share on other sites More sharing options...
Larry Posted August 13, 2014 Share Posted August 13, 2014 Nope. PHP is generally whitespace insensitive. Using spaces there just makes it easier to read. Spaces in HTML can increase the loading time, but that doesn't mean they should be avoided there, either. I'm virtually positive that additional spacing in PHP won't affect performance at all. Link to comment Share on other sites More sharing options...
Recommended Posts