Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/06/2012, 14:09
Avatar de masterpuppet
masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: Verificar valores de un array sean numericos

Hay muchas formas de resolverlo, puedes utilizar array_filter + count , algo asi:

Código PHP:
Ver original
  1. $arr = array(
  2.     2,5,8,19
  3. );
  4.  
  5. echo count(array_filter($arr, function($value){
  6.     return is_numeric($value) && $value > 1 && $value < 20;
  7. })) == count($arr) ? 'T' : 'F';

Saludos.
__________________
http://es.phptherightway.com/
thats us riders :)