Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/05/2010, 20:23
Jamati
 
Fecha de Ingreso: febrero-2008
Mensajes: 578
Antigüedad: 16 años, 2 meses
Puntos: 3
IF o SWITCH CASE

Hola,

En caso de tener por ejemplo una condición que puede ser del 1 al 10, que es mas rápido, usar

if ($variable == 1) {}
if ($variable == 2) {}
if ($variable == 3) {}
if ($variable == 4) {}
if ($variable == 5) {}
if ($variable == 6) {}
if ($variable == 7) {}
if ($variable == 8) {}
if ($variable == 9) {}
if ($variable == 10) {}

o me conviene usar un

switch ($variable)
case 1
...
case 2
...
etc etc

??