bcmod

string bcmod(string operand, string modulus) 
operand Number to divide
modulus Modulus

Determines the modulus of a number.

Returns:

Modulus of operand

Description:

Returns the modulus of the first number, using the second number. This function doesn’t use a decimal-places modifier.

Version:

Existing since version 3.0

Example:

Calculate modulus from two large numbers
$num1 = "9912343"; 
$num2 = "10"; 
echo bcmod($num1,$num2); 

Output: 
3 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.