On 05/31/2010 04:58 PM, Aleksey Zapparov wrote:
Hello,

To test if string is integer or float, you should use
Zend_Validate_Int (1). Alternatively
you can use Zend_Validate_Callback (2) with is_numeric (3) function,
so it will be
something like this:

$validator = new Zend_Validate_Callback('is_numeric');


[1] http://framework.zend.com/apidoc/1.10/Zend_Validate/Zend_Validate_Int.html
[2] 
http://framework.zend.com/apidoc/1.10/Zend_Validate/Zend_Validate_Callback.html
[3] http://php.net/manual/en/function.is-numeric.php

Thanks for the quick response, Aleksey.

I tried configuring Zend_Validate_Callback with PHP function is_numeric().

Zend_Validate_Callback passes two arguments to is_numeric while the PHP function is_numeric() requires exactly one argument. Is there a way to configure Zend_Validate_Callback so that it sends only one argument, ie, $value to the callback function?

--

With warm regards,
Sudheer. S
Tech stuff: http://techchorus.net
Business: http://binaryvibes.co.in

Reply via email to