vijdev Posted September 19, 2010 Share Posted September 19, 2010 can i do something like this? <?php switch ($i) { case 0: echo "i equals 0";?> ////////////// html stuff //////// <?php break; case 1: echo "i equals 1"; ?> ///////////////////html stuff////////////// <?php break; case 2: echo "i equals 2"; ?> ////////////html stuff/////////////// <?php break; } ?> Link to comment https://forums.phpfreaks.com/topic/213808-switch-case-q/ Share on other sites More sharing options...
litebearer Posted September 19, 2010 Share Posted September 19, 2010 Did you try it? Did it work or did you get an error? EXPERIMENT! If you make a habit if backing up scripts and data, experimentation will not harm you, it will allow you to find answers. Link to comment https://forums.phpfreaks.com/topic/213808-switch-case-q/#findComment-1112797 Share on other sites More sharing options...
fortnox007 Posted September 19, 2010 Share Posted September 19, 2010 Looks good to me : ) might want to add a default to the switch Link to comment https://forums.phpfreaks.com/topic/213808-switch-case-q/#findComment-1112799 Share on other sites More sharing options...
vijdev Posted September 20, 2010 Author Share Posted September 20, 2010 works! Link to comment https://forums.phpfreaks.com/topic/213808-switch-case-q/#findComment-1113006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.