PHP fmod() function with example

 15 - Mar - 2022
 XpertPhp
 65

In this article, We will explain to you PHP fmod() function with example.

PHP fmod() function

The fmod() function is a built-in function of PHP. which is used to divides x by y and returns the remainder(modulo) of the division. so you can see our PHP math Function example.

Syntax

fmod(x,y);

Example

<?PHP
echo fmod(3,15);
echo "
";
echo fmod(10,30);
echo "
";
echo fmod(1,50);
?>

Output

3
10
1

Reference: PHP fmod() function