Home > Backend Development > PHP Tutorial > How to use php fmod function

How to use php fmod function

藏色散人
Release: 2023-04-04 22:16:01
Original
4119 people have browsed it

PHP fmod function returns the floating-point remainder of division, that is, the remainder after dividing two values. The syntax is fmod(X,Y), which returns the remainder of the parameters X/Y.

How to use php fmod function

#How to use the fmod function?

Function: The function of fmod() function is the remainder after dividing two values ​​​​

Syntax:

fmod(X,Y)
Copy after login

Parameters:

X is required, X is the divisor

Y is required, the dividend, if Y is 0, the fmod return value is ##php fmod() function usage example:

<?php
$a = 5.5;
$b = 3.2;
$c = fmod($a,$b);
$i = 5;
$j = 3;
$k = fmod($i,$j);
echo $c."*****".$k;
?>
Copy after login

Output:

2.3*****2
Copy after login
This article is an introduction to the PHP fmod function. I hope it will be helpful to friends in need!

The above is the detailed content of How to use php fmod function. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template