Hi,
I have done a little digging and have found out about switch...case statements. I like them because they look cleaner than extremely long if...else chains.
My question is this: if I have an extremely long if...else chain which then becomes a very long switch...case statement, can I somehow use a for loop to build the case statement? Maybe store the case parameters in an array?
I am creating a php application but my code is very long and very inefficient. I would like to make it neater and more logical. I think I have hardcoded so many work-arounds that it is a very large mess.
Do you have any suggestions on how to think about solving this? Or could you tell me where to look?
Any suggestions you could give would be appreciated.
I've attached a file with the lengthy switch statements in it.