<?php
if( $my_form_var % 50 ){
echo "$my_form_var is not a multiple of 50!";
}
?>
the % is the modulus operator meaning it returns the remainder of a
division operation. If the number is divisible by 50 the remainder is 0 (
aka false for the if statement ) other wise it is not 0 ( aka true )
http://www.php.net/manual/nl/language.operators.php
morgan
At 04:42 PM 4/12/2001, you wrote:
> I have to make sure that a number entered into a field is divisible by 50
>but I am unsure how to validate the number to make sure that is the case
>before it goes into the db.
>
>george
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]