Switch Case in php Multiple Case run in function? -


switch(n){ case "badge01": case "badge02": case "badge03": case "badge04": case "badge05": //dosomething      break; } 

hi above's switch case statement, use function run multiple loop generate case's name, can know how generate function on switch case statement this?

switch(n){ case badgenameloop(): //dosomething      break; } 

and possible that?

thanks , sorry bad english.

according php manual

the case expression may expression evaluates simple type, is, integer or floating-point numbers , strings. arrays or objects cannot used here unless dereferenced simple type.

i'm afraid can not have loop case statement, hence waste of time trying.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -