Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Casting with validation rules.
#1

[eluser]TheFuzzy0ne[/eluser]
Is there a simple way to cast a variable from a validation rule?

I need something like this:
Code:
function force_int($int) { return (int)$int; }

...but hopefully, without having to create a custom helper. Does anyone know if there is a native equivalent?
#2

[eluser]wiredesignz[/eluser]
Try intval($val); http://php.net/intval
#3

[eluser]TheFuzzy0ne[/eluser]
Nice one, thanks! I knew of it's existence, but had a serious case of brain block when it came to remembering the name of it.




Theme © iAndrew 2016 - Forum software by © MyBB