Ver Mensaje Individual
  #13 (permalink)  
Antiguo 21/02/2017, 18:00
Avatar de adryan310
adryan310
 
Fecha de Ingreso: septiembre-2012
Mensajes: 450
Antigüedad: 11 años, 8 meses
Puntos: 3
Respuesta: ¿Como validar si un numero realmente es entero?

Cita:
Iniciado por Triby2 Ver Mensaje
Fácil, utiliza
Código PHP:
 filter_var($numeroFILTER_VALIDATE_INT
si te devuelve true entonces representalo así

Código PHP:
(int) $numero 
Amigo hice lo siguiente y no me sirvio, cheka mi codigo:
Código PHP:
                if(filter_var($row['cantidad_tmp'], FILTER_VALIDATE_INT) == true)
           
$cantidad number_format($row['cantidad_tmp'],0);
        else
           
$cantidad=number_format($row['cantidad_tmp'],3); 
Dime en que podria estar fallando, gracias