Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/10/2003, 10:47
Avatar de Mignola
Mignola
 
Fecha de Ingreso: noviembre-2002
Ubicación: Templo Shaolin
Mensajes: 167
Antigüedad: 21 años, 5 meses
Puntos: 1
Sobre 'switch'

Hola a tod@s!!

Les comento un problemilla:
En ASP yo tenia esta funcion
--------------------------------
function imagen(nivel)
Select case nivel
case "1","2"
imagen = "..."
case "3","4","5"
imagen = "..."
case "6","7"
imagen = "..."
End select
end function
--------------------------------

Como se puede hacer algo parecido con switch, ya probe esto y no va:
function imagen($nivel){
switch ($nivel) {
case 1 || 2:
$imagen = "...";
break;
case 3 || 4 || 5:
$imagen = "...";
break;
case 6 || 7:
$imagen ="...";
break;
}

return $imagen;

No se como tendria q hacer, si pueden echarme una manilla....

Gracias!!