Home >Backend Development >PHP Tutorial >How to use php fmod function
PHP fmod function returns the floating-point remainder of division, that is, the remainder after dividing two values. The syntax is fmod(X,Y), which returns the remainder of the parameters X/Y.
#How to use the fmod function?
Function: The function of fmod() function is the remainder after dividing two values
Syntax:
fmod(X,Y)
Parameters:
X is required, X is the divisor
Y is required, the dividend, if Y is 0, the fmod return value is ##php fmod() function usage example:
<?php $a = 5.5; $b = 3.2; $c = fmod($a,$b); $i = 5; $j = 3; $k = fmod($i,$j); echo $c."*****".$k; ?>Output:
2.3*****2This article is an introduction to the PHP fmod function. I hope it will be helpful to friends in need!
The above is the detailed content of How to use php fmod function. For more information, please follow other related articles on the PHP Chinese website!