Return the remainder of x/y:
<?php
echo(fmod(20, 4) . "<br>");
echo(fmod(20, 3) . "<br>");
echo(fmod(15, 6) . "<br>");
echo(fmod(-10, 3) . "<br>");
echo(fmod(0, 0));
?>
Try it Yourself »
The fmod() function returns the remainder (modulo) of x/y.
fmod(
x,y);
Parameter | Description |
---|---|
x | Required. Specifies the dividend |
y | Required. Specifies the divisor |
Return Value: | The floating point remainder of x/y |
---|---|
Return Type: | Float |
PHP Version: | 4.2+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!