Function to find the smallest number greater than or equal to N that is divisible by k
< ? php function findNum ( $ N , $ K ) { $ rem = ( $ N + $ K ) % $ K ; if ( $ rem == 0 ) return $ N ; else return $ N + $ K - $ rem ; }