Ver Mensaje Individual
  #7 (permalink)  
Antiguo 14/05/2012, 08:24
lolocripto
 
Fecha de Ingreso: diciembre-2010
Mensajes: 79
Antigüedad: 13 años, 4 meses
Puntos: 3
Respuesta: Zend Validate Float

He cogido y he hecho esto mismo

Código PHP:
Ver original
  1. use Zend\Validator\Float;
  2.  
  3. $validator=new Float();
  4.            
  5.             $validator->setLocale('en');
  6.             echo "primero";
  7.             \Zend\Debug::dump($validator->isValid(234.5));
  8.             echo "segundo";
  9.             \Zend\Debug::dump($validator->isValid('234.5'));
  10.             echo "tercero";
  11.             \Zend\Debug::dump($validator->isValid('234,5'));

y el primero me da true y el segundo y tercero false