dennismonsewicz Posted April 1, 2008 Share Posted April 1, 2008 Whats the difference between the two If.. Else Statements? if($var) echo "..."; else echo "???"; if($var) { echo "..."; } else { echo "???"; } Quote Link to comment Share on other sites More sharing options...
trq Posted April 1, 2008 Share Posted April 1, 2008 Nothing. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted April 1, 2008 Author Share Posted April 1, 2008 then why use the brackets vs not using them? Quote Link to comment Share on other sites More sharing options...
trq Posted April 1, 2008 Share Posted April 1, 2008 The brackets are required for more complex expressions. IMO they also make code easier to follow by grouping each block. 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.