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
Post a Comment