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 "???"; } Link to comment https://forums.phpfreaks.com/topic/99002-different-if-statements/ Share on other sites More sharing options...
trq Posted April 1, 2008 Share Posted April 1, 2008 Nothing. Link to comment https://forums.phpfreaks.com/topic/99002-different-if-statements/#findComment-506596 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? Link to comment https://forums.phpfreaks.com/topic/99002-different-if-statements/#findComment-506598 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. Link to comment https://forums.phpfreaks.com/topic/99002-different-if-statements/#findComment-506601 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.