PHP fmod() Function

The fmod() function returns the remainder (modulo) of x/y.

float fmod ( float $x , float $y )

Returns the floating point remainder of dividing the dividend (x) by the divisor (y). The remainder (r) is defined as: x = i * y + r, for some integer i. If y is non-zero, r has the same sign as x and a magnitude less than the magnitude of y.

Example -

ParameterDescription
xThe dividend
yThe divisor

The floating point remainder of x/y