X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP fmod() Function

PHP Math Reference PHP Math Reference

Example

Return the remainder of x/y:

<?php
$x = 7;
$y = 2;
$result = fmod($x,$y);
echo $result;
// $result equals 1, because 2 * 3 + 1 = 7
?>

Run example »

Definition and Usage

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


Syntax

fmod(x,y);

Parameter Description
x Required. Specifies the dividend
y Required. Specifies the divisor

Technical Details

Return Value: The floating point remainder of x/y
Return Type: Float
PHP Version: 4.2+


PHP Math Reference PHP Math Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook