steveh62 Posted October 17, 2008 Share Posted October 17, 2008 I have multiple switch($x){ case a: foo = 1; break; } switch($y){ case a: foobar = 1; break; } prob I am getting is an error syntax error, unexpected '=' on line n ?? help please does php work with multiple switch case statments?? Link to comment https://forums.phpfreaks.com/topic/128859-solved-multiple-switch-statements/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 17, 2008 Share Posted October 17, 2008 Strings must be enclosed in quotes - case 'a': Link to comment https://forums.phpfreaks.com/topic/128859-solved-multiple-switch-statements/#findComment-668023 Share on other sites More sharing options...
steveh62 Posted October 17, 2008 Author Share Posted October 17, 2008 err sorry yes...forgot that...so can I have many switch statments? I am getting errors Link to comment https://forums.phpfreaks.com/topic/128859-solved-multiple-switch-statements/#findComment-668028 Share on other sites More sharing options...
PFMaBiSmAd Posted October 17, 2008 Share Posted October 17, 2008 You would need to post your actual code and the actual errors to get any specific help with the problem in your code. And if that is your actual code, you don't have any $ in front of foo and foobar. Link to comment https://forums.phpfreaks.com/topic/128859-solved-multiple-switch-statements/#findComment-668031 Share on other sites More sharing options...
rhodesa Posted October 17, 2008 Share Posted October 17, 2008 yes, you can have multiple switch statements Link to comment https://forums.phpfreaks.com/topic/128859-solved-multiple-switch-statements/#findComment-668034 Share on other sites More sharing options...
steveh62 Posted October 17, 2008 Author Share Posted October 17, 2008 ok working now Link to comment https://forums.phpfreaks.com/topic/128859-solved-multiple-switch-statements/#findComment-668046 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.