0
what is the missing syntax in my codes that will make my codes run in alternative way rather than in curly brace syntax ?
!DOCTYPE html> <html> <head> <title></title> </head> <body> <?php $i = 5; switch ($i) { case 0: echo '$i is 0.'; break; case 1: case 2: case 3: case 4: case 5: echo '$i is somewhere between 1 and 5.'; break; case 6: case 7: echo '$i is either 6 or 7.'; break; default: echo "I don't know how much \$i is."; } ?> </body> </html>
2 odpowiedzi
+ 4
The curly braces are anchors to define where things begin and where they end, why should you be concerned about those braces?
Anyway, did you notice your code started with:
!DOCTYPE html>
instead of:
<!DOCTYPE html>
+ 3
For future ference, when posting about code, please make the code and then insert it into the question, it is much more effecient, and the reason they allow you to do it.