fmod() function in PHP


The fmod() function Returns the modulo of dividend/ divisor. Floating modulo in fmod.

Syntax

fmod(dividend/ divisor)

Parameters

  • dividend − The number to be divided.

  • divisor − This is the number that divides.

Return

The fmod() function Returns the remainder of dividend/ divisor.

Example

 Live Demo

<?php
   $p = 30;
   $q = 9;
   $remainder = fmod($p,$q);
   echo $remainder;
?>

Output

3

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 26-Jun-2020

135 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements