php
mod or remainder using fmod() PHP
<?php
echo fmod(15, 5); //output - 0
echo fmod(15, 4); //output - 3
?>
Output
0
3
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.
Was this helpful?
Similar Posts
- Send POST request without using curl using PHP 5+
- Convert characters to lowercase using strtolower() function in PHP
- Calculate length of a string using strlen() function in php
- Connect Mysql and PHP using mysqli
- Get last insert id in db using PHP
- Read file content using PHP
- Create new file and write data to it using PHP