Posted by Janwillem Borleffs on 05/05/06 12:40
jenngra@gmail.com wrote:
> Hello! Can someone pls help me create a string filter, which will only
> pass currency amounts
>
> "0.00" to "999999.99" and nothing else. So, I need a decimal in there
> and don't understand the filter process, so if you could briefly
> explain how it works that would be so great :) TAM! -Jennifer
>
One way would be to apply casting:
$num = "0.005";
$num2 = "a0.005";
print (float) $num ? 1 : 0; // prints 1
print (float) $num2 ? 1 : 0; // prints 0
JW
Navigation:
[Reply to this message]
|