Search code snippets, questions, articles...

mod or remainder using fmod() PHP

<?php
    echo fmod(15, 5); //output - 0
    echo fmod(15, 4); //output - 3
?>
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place.
Output
0
3

To find the remainder of a/b, you can use fmod() function of PHP. This takes two required parameters. The first parameter is the value that needs to be divided and the second is from which number it is to be divided.

Search Index Data (The code snippet can also be found with below search text)

fmod() function PHP
Was this helpful?
0 Comments