|
Posted by Scott Johnson on 11/15/05 00:42
Chung Leong wrote:
> Darren wrote:
>
>>Hello,
>>
>>I am sure this subject has been done to death, but I would like to make
>>sure that a form post is an interger or a float.
>>
>>I have used
>>
>> if (!ctype_digit($current_value)
>>
>>but this is true if the number contains a decimal point.
>>
>>I probably need a good tutorial/guide on form validation.
>>
>>
>>Darren
>
>
> There is is_numeric(), although the function is buggy in that it
> doesn't recognize ".05" as a number.
>
is_numeric will recognize decimals such as .05 as numeric. It may be
that your code is type casting that value to a char.
If you can maybe send some code, unless someone in here has an opinion
on this.
Navigation:
[Reply to this message]
|